diff --git a/CHANGELOG.md b/CHANGELOG.md index c92b7678f..73ed5b869 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +27.0.0 +------ + - Compatibility with v16 of the API: https://developers.google.com/google-ads/api/docs/release-notes + 26.0.0 ------ - Removed support for v13. diff --git a/examples/account_management/verify_advertiser_identity.rb b/examples/account_management/verify_advertiser_identity.rb new file mode 100755 index 000000000..9aa8531dd --- /dev/null +++ b/examples/account_management/verify_advertiser_identity.rb @@ -0,0 +1,131 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright 2024 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 code example illustrates how to retrieve the status of the advertiser +# identity verification program and, if required and not already started, how +# to start the verification process. + +require 'optparse' +require 'date' +require 'google/ads/google_ads' + +def verify_advertiser_identity(customer_id) + # GoogleAdsClient will read a config file from + # ENV['HOME']/google_ads_config.rb when called without parameters + client = Google::Ads::GoogleAds::GoogleAdsClient.new + + client.configure do |config| + config.login_customer_id = customer_id + end + + identity_verification = get_identity_verification(client, customer_id) + + if identity_verification.nil? + puts "Account #{customer_id} is not required to perform mandatory identity verification." + puts "See https://support.google.com/adspolicy/answer/9703665 for details on how " \ + "and when an account is required to undergo the advertiser identity " \ + "verification program." + else + if identity_verification.verification_progress.action_url.nil? + start_identity_verification(client, customer_id) + + # Call GetIdentityVerification again to retrieve the verification + # progress after starting an identity verification session. + get_identity_verification(client, customer_id) + else + # If there is an identity verification session in progress, there is no + # need to start another one by calling start_identity_verification. + puts "There is an advertiser identity verification session in progress." + + progress = identity_verification.verification_progress + puts "The URL for the verification process is #{progress.action_url} and " \ + "it will expire at #{progress.invitation_link_expiration_time}." + end + end +end + +# [START verify_advertiser_identity_1] +def get_identity_verification(client, customer_id) + response = client.service.identity_verification.get_identity_verification( + customer_id: customer_id + ) + + return nil if response.nil? || response.identity_verification.empty? + + identity_verification = response.identity_verification.first + deadline = identity_verification. + identity_verification_requirement. + verification_completion_deadline_time + progress = identity_verification.verification_progress + puts "Account #{customer_id} has a verification completion deadline " \ + "of #{deadline} and status #{progress.program_status} for advertiser " \ + "identity verification." + + identity_verification +end +# [END verify_advertiser_identity_1] + +# [START verify_advertiser_identity_2] +def start_identity_verification(client, customer_id) + client.service.identity_verification.start_identity_verification( + customer_id: customer_id, + verification_program: :ADVERTISER_IDENTITY_VERIFICATION, + ) +end +# [END verify_advertiser_identity_2] + +if __FILE__ == $PROGRAM_NAME + # Running the example with -h will print the command line usage. + options = {} + + OptionParser.new do |opts| + opts.banner = sprintf('Usage: ruby %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 + verify_advertiser_identity(options.fetch(:customer_id).tr("-", "")) + 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 + raise + end +end diff --git a/examples/advanced_operations/get_ad_group_bid_modifiers.rb b/examples/advanced_operations/get_ad_group_bid_modifiers.rb index 509b8c15f..c7daab7ed 100644 --- a/examples/advanced_operations/get_ad_group_bid_modifiers.rb +++ b/examples/advanced_operations/get_ad_group_bid_modifiers.rb @@ -58,15 +58,16 @@ def get_ad_group_bid_modifiers(customer_id, ad_group_id = nil) ad_group_bid_modifier = row.ad_group_bid_modifier ad_group = row.ad_group campaign = row.campaign - bid_modifier = '"nil"' - if ad_group_bid_modifier.bid_modifier - bid_modifier = sprintf("%.2f", ad_group_bid_modifier.bid_modifier) + print "Ad group bid modifier with criterion ID #{ad_group_bid_modifier.criterion_id} in " \ + "ad group ID #{ad_group.id} of campaign ID #{campaign.id} " + + if ad_group_bid_modifier.has_bid_modifier? + puts "has a bid modifier value of #{sprintf("%.2f", ad_group_bid_modifier.bid_modifier)}." + else + puts "does NOT have a bid modifier value." end - puts "Ad group bid modifier with criterion ID #{ad_group_bid_modifier.criterion_id}, bid " \ - "modifier value #{bid_modifier} was found in an ad group with ID #{ad_group.id} of " \ - "campaign ID #{campaign.id}." criterion_details = " - Criterion type: #{ad_group_bid_modifier.criterion}, " diff --git a/examples/extensions/add_call.rb b/examples/assets/add_call.rb similarity index 97% rename from examples/extensions/add_call.rb rename to examples/assets/add_call.rb index f4c9ef539..3f3d7fe67 100644 --- a/examples/extensions/add_call.rb +++ b/examples/assets/add_call.rb @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example adds a call extension to a specific account. +# This example adds a call asset to a specific account. require 'date' require 'google/ads/google_ads' @@ -29,7 +29,7 @@ def add_call(customer_id, # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new - asset_resource_name = add_extension_asset(client, + asset_resource_name = add_call_asset(client, customer_id, phone_number, phone_country, @@ -37,7 +37,7 @@ def add_call(customer_id, link_asset_to_account(client, customer_id, asset_resource_name) end -def add_extension_asset(client, +def add_call_asset(client, customer_id, phone_number, phone_country, diff --git a/examples/extensions/add_hotel_callout.rb b/examples/assets/add_hotel_callout.rb similarity index 90% rename from examples/extensions/add_hotel_callout.rb rename to examples/assets/add_hotel_callout.rb index c0c4cd81a..f47431606 100644 --- a/examples/extensions/add_hotel_callout.rb +++ b/examples/assets/add_hotel_callout.rb @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example adds a hotel callout extension to a specific account. +# This example adds a hotel callout asset to a specific account. require 'optparse' require 'google/ads/google_ads' @@ -26,16 +26,16 @@ def add_hotel_callout(customer_id, language_code) # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new - # Creates an extension feed item as hotel callout. - asset_resource_names = add_assets(client, customer_id, language_code) + # Creates a hotel callout asset. + asset_resource_names = add_hotel_callout_assets(client, customer_id, language_code) - # Adds the extension feed item to the account. + # Adds the asset at the account level, so it will serve in all eligible campaigns. link_assets_to_account(client, customer_id, asset_resource_names) end -# Creates a new extension feed item for the callout extension. -def add_assets(client, customer_id, language_code) +# Creates a new asset. +def add_hotel_callout_assets(client, customer_id, language_code) operations = [ client.resource.hotel_callout_asset do |hca| hca.text = 'Activities' @@ -62,7 +62,7 @@ def add_assets(client, customer_id, language_code) end end -# Adds the extension feed item to the customer account. +# Adds the asset to the customer account. def link_assets_to_account(client, customer_id, asset_resource_names) operations = asset_resource_names.map do |asset_resource_name| client.operation.create_resource.customer_asset do |ca| diff --git a/examples/extensions/add_lead_form_extension.rb b/examples/assets/add_lead_form_asset.rb similarity index 93% rename from examples/extensions/add_lead_form_extension.rb rename to examples/assets/add_lead_form_asset.rb index dd6d7045e..bf3e437bf 100755 --- a/examples/extensions/add_lead_form_extension.rb +++ b/examples/assets/add_lead_form_asset.rb @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Creates a lead form and a lead form extension for a campaign. +# Creates a lead form and a lead form asset for a campaign. # # Run add_campaigns.rb to create a campaign. @@ -23,7 +23,7 @@ require 'google/ads/google_ads' require 'date' -def add_lead_form_extension(customer_id, campaign_id) +def add_lead_form_asset(customer_id, campaign_id) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new @@ -33,7 +33,7 @@ def add_lead_form_extension(customer_id, campaign_id) customer_id, ) - create_lead_form_extension( + create_lead_form_campaign_asset( client, customer_id, campaign_id, @@ -41,7 +41,7 @@ def add_lead_form_extension(customer_id, campaign_id) ) end -# [START add_lead_form_extension] +# [START add_lead_form_asset] def create_lead_form_asset(client, customer_id) operation = client.operation.create_resource.asset do |a| a.name = "Interplanetary Cruise #{(Time.new.to_f * 1000).to_i} Lead Form" @@ -107,10 +107,10 @@ def create_lead_form_asset(client, customer_id) puts "Asset with resource name #{asset_name} was created." asset_name end -# [END add_lead_form_extension] +# [END add_lead_form_asset] -# [START add_lead_form_extension_1] -def create_lead_form_extension(client, customer_id, campaign_id, lead_form_asset) +# [START add_lead_form_asset_1] +def create_lead_form_campaign_asset(client, customer_id, campaign_id, lead_form_asset) operation = client.operation.create_resource.campaign_asset do |ca| ca.asset = lead_form_asset ca.field_type = :LEAD_FORM @@ -125,7 +125,7 @@ def create_lead_form_extension(client, customer_id, campaign_id, lead_form_asset puts "Created campaign asset #{response.results.first.resource_name} for " \ "campaign #{campaign_id}." end -# [END add_lead_form_extension_1] +# [END add_lead_form_asset_1] if __FILE__ == $0 options = {} @@ -164,7 +164,7 @@ def create_lead_form_extension(client, customer_id, campaign_id, lead_form_asset end.parse! begin - add_lead_form_extension( + add_lead_form_asset( options.fetch(:customer_id).tr("-", ""), options.fetch(:campaign_id), ) diff --git a/examples/extensions/add_prices.rb b/examples/assets/add_prices.rb similarity index 93% rename from examples/extensions/add_prices.rb rename to examples/assets/add_prices.rb index 717dd2cf2..5c9793a3a 100755 --- a/examples/extensions/add_prices.rb +++ b/examples/assets/add_prices.rb @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Adds a price extension and associates it with an account. +# Adds a price asset and associates it with an account. require 'optparse' require 'google/ads/google_ads' @@ -34,8 +34,6 @@ def add_prices(customer_id) end def create_price_asset(client, customer_id) - # The operation creates a customer extension setting with price feed item. - # This associates the price extension to your account. operation = client.operation.create_resource.asset do |asset| asset.name = "Price Asset ##{(Time.new.to_f * 1000).to_i}" asset.tracking_url_template = 'http://tracker.example.com/?u={lpurl}' @@ -45,7 +43,7 @@ def create_price_asset(client, customer_id) price.price_qualifier = :FROM price.language_code = 'en' - # To create a price extension, at least three price offerings are needed. + # To create a price asset, at least three price offerings are needed. price.price_offerings << create_price_offer( client, 'Scrubs', 'Body Scrub, Salt Scrub', 60_000_000, # 60 USD 'USD', :PER_HOUR, 'http://www.example.com/scrubs', @@ -67,7 +65,7 @@ def create_price_asset(client, customer_id) ) resource_name = response.results.first.resource_name - puts "Created extension feed with resource name '#{resource_name}'" + puts "Created asset with resource name '#{resource_name}'" resource_name end diff --git a/examples/extensions/add_sitelinks_using_assets.rb b/examples/assets/add_sitelinks.rb similarity index 96% rename from examples/extensions/add_sitelinks_using_assets.rb rename to examples/assets/add_sitelinks.rb index bbb18fb0d..290270825 100755 --- a/examples/extensions/add_sitelinks_using_assets.rb +++ b/examples/assets/add_sitelinks.rb @@ -21,7 +21,7 @@ require 'google/ads/google_ads' require 'date' -def add_sitelinks_using_assets(customer_id, campaign_id) +def add_sitelinks(customer_id, campaign_id) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new @@ -133,7 +133,7 @@ def link_sitelinks_to_campaign(client, resource_names, customer_id, campaign_id) end.parse! begin - add_sitelinks_using_assets(options.fetch(:customer_id).tr("-", ""), options.fetch(:campaign_id)) + add_sitelinks(options.fetch(:customer_id).tr("-", ""), options.fetch(:campaign_id)) rescue Google::Ads::GoogleAds::Errors::GoogleAdsError => e e.failure.errors.each do |error| STDERR.printf("Error with message: %s\n", error.message) diff --git a/examples/extensions/add_affiliate_location_extensions.rb b/examples/extensions/add_affiliate_location_extensions.rb deleted file mode 100755 index bfe6fa890..000000000 --- a/examples/extensions/add_affiliate_location_extensions.rb +++ /dev/null @@ -1,375 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2020 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 code example adds a feed that syncs retail addresses for a given retail -# chain ID and associates the feed with a campaign for serving affiliate -# location extensions. - -require 'optparse' -require 'google/ads/google_ads' -require 'date' - -def add_affiliate_location_extensions( - customer_id, - chain_id, - campaign_id, - should_delete_existing_feeds) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - if should_delete_existing_feeds - delete_location_extension_feeds(client, customer_id) - end - - feed_resource_name = create_affiliate_location_extension_feed( - client, - customer_id, - chain_id, - ) - - # After the completion of the feed creation operation above the added feed - # will not be available for usage in a campaign feed until the feed mapping - # is created. We then need to wait for the feed mapping to be created. - feed_mapping = wait_for_feed_to_be_ready( - client, - customer_id, - feed_resource_name, - ) - - create_campaign_feed( - client, - customer_id, - campaign_id, - feed_mapping, - feed_resource_name, - chain_id, - ) -end - -# Deletes the existing location extension feeds. -def delete_location_extension_feeds(client, customer_id) - # To delete a location extension feed, you need to - # 1. Delete the customer feed so that the location extensions from the feed - # stop serving. - # 2. Delete the feed so that Google Ads will no longer sync from the Business - # Profile account. - customer_feeds = get_location_extension_customer_feeds(client, customer_id) - unless customer_feeds.empty? - # Optional: You may also want to delete the campaign and ad group feeds. - remove_customer_feeds(client, customer_id, customer_feeds) - end - feeds = get_location_extension_feeds(client, customer_id) - unless feeds.empty? - remove_feeds(client, customer_id, customer_feeds) - end -end - -# Gets the existing location extension customer feeds. -def get_location_extension_customer_feeds(client, customer_id) - customer_feeds = [] - - # Creates the query. A location extension customer feed can be identified - # by filtering for placeholder_types as LOCATION (location extension feeds) or - # placeholder_types as AFFILIATE_LOCATION (affiliate location extension feeds). - query = <<~QUERY - SELECT customer_feed.resource_name - FROM customer_feed - WHERE customer_feed.placeholder_types CONTAINS ANY(LOCATION, AFFILIATE_LOCATION) - AND customer_feed.status = ENABLED - QUERY - - # Issues a search stream request. - responses = client.service.google_ads.search_stream( - customer_id: customer_id, - query: query, - ) - - # Iterates over all rows in all messages to collect the results. - responses.each do |response| - response.results.each do |row| - customer_feeds << row.customer_feed - end - end - - customer_feeds -end - -# Removes the customer feeds. -def remove_customer_feeds(client, customer_id, customer_feeds) - operations = [] - - customer_feeds.each do |customer_feed| - operations << client.operation.remove_resource.customer_feed( - customer_feed.resource_name) - end - - # Issues a mutate request to remove the customer feeds. - client.service.customer_feed.mutate_customer_feeds(customer_id, operations) -end - -# Gets the existing location extension feeds. -def get_location_extension_feeds(client, customer_id) - feeds = [] - - # Creates the query. - query = <<~QUERY - SELECT feed.resource_name - FROM feed - WHERE feed.status = ENABLED - AND feed.origin = USER - QUERY - - # Issues a search stream request. - responses = client.service.google_ads.search_stream( - customer_id: customer_id, - query: query, - ) - - # Iterates over all rows in all messages to collect the results. - responses.each do |response| - response.results.each do |row| - feeds << row.feed - end - end - - feeds -end - -# Removes the feeds. -def remove_feeds(client, customer_id, feeds) - operations = [] - - feeds.each do |feed| - operations << client.operation.remove_resource.feed(feed.resource_name) - end - - # Issues a mutate request to remove the feeds. - client.service.feed.mutate_feeds(customer_id, operations) -end - -# Creates the affiliate location extension feed. -# [START add_affiliate_location_extensions] -def create_affiliate_location_extension_feed(client, customer_id, chain_id) - # Creates a feed that will sync to retail addresses for a given retail - # chain ID. - # Do not add feed attributes, Google Ads will add them automatically because - # this will be a system generated feed. - operation = client.operation.create_resource.feed do |feed| - feed.name = "Affiliate Location Extension feed ##{(Time.new.to_f * 1000).to_i}" - feed.affiliate_location_feed_data = client.resource.affiliate_location_feed_data do |data| - data.chain_ids << chain_id - data.relationship_type = :GENERAL_RETAILER - end - # Since this feed's contents will be managed by Google, you must set its - # origin to GOOGLE. - feed.origin = :GOOGLE - end - - # Issues a mutate request to add the feed and prints some information. - response = client.service.feed.mutate_feeds( - customer_id: customer_id, - operations: [operation], - ) - - feed_resource_name = response.results.first.resource_name - puts "Affiliate location extension feed created with resource name: #{feed_resource_name}" - - feed_resource_name -end -# [END add_affiliate_location_extensions] - -# Waits for the affiliate location extension feed to be ready. An exponential -# back-off policy with a maximum number of attempts is used to poll the server. -# [START add_affiliate_location_extensions_2] -def wait_for_feed_to_be_ready(client, customer_id, feed_resource_name) - number_of_attempts = 0 - - while number_of_attempts < MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS - # Once you create a feed, Google's servers will setup the feed by creating - # feed attributes and feed mapping. Once the feed mapping is created, it is - # ready to be used for creating customer feed. - # This process is asynchronous, so we wait until the feed mapping is - # created, performing exponential backoff. - feed_mapping = get_affiliated_location_extension_feed_mapping( - client, customer_id, feed_resource_name) - - if feed_mapping.nil? - number_of_attempts += 1 - sleep_seconds = POLL_FREQUENCY_SECONDS * (2 ** number_of_attempts) - puts "Checked #{number_of_attempts} time(s). Feed is not ready yet. " \ - "Waiting #{sleep_seconds} seconds before trying again." - sleep sleep_seconds - else - puts "Feed #{feed_resource_name} is now ready." - return feed_mapping - end - end - - raise "The affiliate location feed mapping is still not ready after " \ - "#{MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS} attempt(s)." -end -# [END add_affiliate_location_extensions_2] - -# Gets the affiliate location extension feed mapping. -# [START add_affiliate_location_extensions_1] -def get_affiliated_location_extension_feed_mapping( - client, - customer_id, - feed_resource_name) - # Creates a query that retrieves the feed mapping. - query = <<~QUERY - SELECT feed_mapping.resource_name, - feed_mapping.attribute_field_mappings, - feed_mapping.status - FROM feed_mapping - WHERE feed_mapping.feed = '#{feed_resource_name}' - AND feed_mapping.status = ENABLED - AND feed_mapping.placeholder_type = AFFILIATE_LOCATION - LIMIT 1 - QUERY - - # Issues a search request - responses = client.service.google_ads.search( - customer_id: customer_id, - query: query, - return_total_results_count: true, - ) - - response = responses.page.response - response.total_results_count == 1 ? response.results.first.feed_mapping : nil -end -# [END add_affiliate_location_extensions_1] - -# Creates the campaign feed. -# [START add_affiliate_location_extensions_3] -def create_campaign_feed( - client, - customer_id, - campaign_id, - feed_mapping, - feed_resource_name, - chain_id) - matching_function = "IN(FeedAttribute[#{feed_resource_name.split('/')[3]}, " \ - "#{get_attribute_id_for_chain_id(feed_mapping)}], #{chain_id})" - - # Adds a campaign feed that associates the feed with this campaign for the - # AFFILIATE_LOCATION placeholder type. - operation = client.operation.create_resource.campaign_feed do |cf| - cf.feed = feed_resource_name - cf.placeholder_types << :AFFILIATE_LOCATION - cf.matching_function = client.resource.matching_function do |m| - m.function_string = matching_function - end - cf.campaign = client.path.campaign(customer_id, campaign_id) - end - - # Issues a mutate request to add the campaign feed and prints some information. - response = client.service.campaign_feed.mutate_campaign_feeds( - customer_id: customer_id, - operations: [operation], - ) - puts "Campaign feed created with resource name: " \ - "#{response.results.first.resource_name}" -end -# [END add_affiliate_location_extensions_3] - -# Gets the feed attribute ID for the retail chain ID. -# [START add_affiliate_location_extensions_4] -def get_attribute_id_for_chain_id(feed_mapping) - feed_mapping.attribute_field_mappings.each do |fm| - if fm.affiliate_location_field == :CHAIN_ID - return fm.feed_attribute_id - end - end - - raise "Affiliate location feed mapping isn't setup correctly." -end -# [END add_affiliate_location_extensions_4] - -if __FILE__ == $0 - POLL_FREQUENCY_SECONDS = 5 - MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS = 10 - - 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' - options[:chain_id] = 'INSERT_CHAIN_ID_HERE' - options[:campaign_id] = 'INSERT_CAMPAIGN_ID_HERE' - options[:should_delete_existing_feeds] = false - - 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('-N', '--chain-id CHAIN-ID', String, 'Chain ID') do |v| - options[:chain_id] = v - end - - opts.on('-c', '--campaign-id CAMPAIGN-ID', String, 'Campaign ID') do |v| - options[:campaign_id] = v - end - - opts.on('-D', '--should-delete-existing-feeds SHOULD-DELETE-EXISTING-FEEDS', - TrueClass, 'Should delete existing feeds') do |v| - options[:should_delete_existing_feeds] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - add_affiliate_location_extensions( - options.fetch(:customer_id).tr("-", ""), - options.fetch(:chain_id).to_i, - options.fetch(:campaign_id), - options[:should_delete_existing_feeds]) - 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 - raise - end -end diff --git a/examples/extensions/add_business_profile_location_extensions.rb b/examples/extensions/add_business_profile_location_extensions.rb deleted file mode 100755 index 033775280..000000000 --- a/examples/extensions/add_business_profile_location_extensions.rb +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2020 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 adds a feed that syncs feed items from a Business Profile -# account and associates the feed with a customer. - -require 'optparse' -require 'google/ads/google_ads' -require 'date' - -def add_business_profile_location_extensions( - customer_id, - business_profile_email_address, - business_profile_access_token, - business_account_identifier) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - business_profile_feed_resource_name = create_feed( - client, - customer_id, - business_profile_email_address, - business_profile_access_token, - business_account_identifier, - ) - - create_customer_feed(client, customer_id, business_profile_feed_resource_name) -end - -# [START add_business_profile_location_extensions] -def create_feed( - client, - customer_id, - business_profile_email_address, - business_profile_access_token, - business_account_identifier) - # Creates a feed operation. - operation = client.operation.create_resource.feed do |feed| - feed.name = "Business Profile feed #{(Time.new.to_f * 1000).to_i}" - feed.origin = :GOOGLE - feed.places_location_feed_data = client.resource.places_location_feed_data do |data| - data.email_address = business_profile_email_address - data.business_account_id = business_account_identifier - data.label_filters << "Stores in New York" - data.oauth_info = client.resource.o_auth_info do |oauth| - oauth.http_method = "GET" - oauth.http_request_url = "https://www.googleapis.com/auth/adwords" - oauth.http_authorization_header = "Bearer #{business_profile_access_token}" - end - end - end - - # [START add_business_profile_location_extensions_1] - # Issues a mutate request to add the feed and print its information. - # Since it is a system generated feed, Google Ads will automatically: - # 1. Set up the feed attributes on the feed. - # 2. Set up a feed mapping that associates the feed attributes of the feed with the - # placeholder fields of the LOCATION placeholder type. - response = client.service.feed.mutate_feeds( - customer_id: customer_id, - operations: [operation], - ) - - # Prints out the Business Profile feed resource name. - business_profile_feed_resource_name = response.results.first.resource_name - puts "Business Profile feed created with resource name: #{business_profile_feed_resource_name}" - - business_profile_feed_resource_name - # [END add_business_profile_location_extensions_1] -end -# [END add_business_profile_location_extensions] - -# [START add_business_profile_location_extensions_2] -def create_customer_feed( - client, - customer_id, - business_profile_feed_resource_name) - # Creates a customer feed operation. - operation = client.operation.create_resource.customer_feed do |cf| - cf.feed = business_profile_feed_resource_name - cf.placeholder_types << :LOCATION - cf.matching_function = client.resource.matching_function do |m| - m.left_operands << client.resource.operand do |op| - op.constant_operand = client.resource.constant_operand do |co| - co.boolean_value = true - end - end - m.function_string = "IDENTITY(true)" - m.operator = :IDENTITY - end - end - - # [START add_business_profile_location_extensions_3] - # After the completion of the feed ADD operation above the added feed will - # not be available for usage in a customer feed until the sync between the - # Google Ads and Business Profile accounts completes. The loop below will - # retry adding the customer feed up to ten times with an exponential back-off - # policy. - number_of_attempts = 0 - added_customer_feed = nil - customer_feed_service_client = client.service.customer_feed - - loop do - number_of_attempts += 1 - begin - # Issues a mutate request to add a customer feed and print its information - # if the request succeeded. - response = customer_feed_service_client.mutate_customer_feeds( - customer_id: customer_id, - operations: [operation] - ) - puts "Customer feed created with resource name: " \ - "#{response.results.first.resource_name}" - rescue Google::Ads::GoogleAds::Errors::GoogleAdsError => e - # Waits using exponential backoff policy - sleep_seconds = POLL_FREQUENCY_SECONDS * (2 ** number_of_attempts) - puts "Attempt #{number_of_attempts} to add the customer feed was " \ - "not successful. Waiting #{sleep_seconds} seconds before trying again." - sleep sleep_seconds - end - break if number_of_attempts >= MAX_CUSTOMER_FEED_ADD_ATTEMPTS || added_customer_feed - end - # [END add_business_profile_location_extensions_3] - - if added_customer_feed.nil? - raise "Could not create the customer feed after #{MAX_CUSTOMER_FEED_ADD_ATTEMPTS} " \ - "attempts. Please retry the customer feed ADD operation later." - end -end -# [END add_business_profile_location_extensions_2] - -if __FILE__ == $0 - # The maximum number of customer feed ADD operation attempts to make before - # throwing an exception. - MAX_CUSTOMER_FEED_ADD_ATTEMPTS = 10 - POLL_FREQUENCY_SECONDS = 5 - - 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' - options[:campaign_id] = 'INSERT_CAMPAIGN_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('-E', '--business-profile-email-address BUSINESS-PROFILE-EMAIL-ADDRESS', - String, 'Business Profile Email Address') do |v| - options[:business_profile_email_address] = v - end - - opts.on('-T', '--business-profile-access-token BUSINESS-PROFILE-ACCESS-TOKEN', String, - 'Business Profile Access Token') do |v| - options[:business_profile_access_token] = v - end - - opts.on('-B', '--business-account-identifier BUSINESS-ACCOUNT-IDENTIFIER', String, 'Business Account Identifier') do |v| - options[:business_account_identifier] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - add_business_profile_location_extensions( - options.fetch(:customer_id).tr("-", ""), - options.fetch(:business_profile_email_address), - options.fetch(:business_profile_access_token), - options.fetch(:business_account_identifier), - ) - 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 - raise - end -end diff --git a/examples/extensions/add_geo_target.rb b/examples/extensions/add_geo_target.rb deleted file mode 100755 index 78f8dc53c..000000000 --- a/examples/extensions/add_geo_target.rb +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2020 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 adds a geo target to an extension feed item for targeting. - -require 'optparse' -require 'google/ads/google_ads' -require 'date' - -# [START add_geo_target] -def add_geo_target(customer_id, feed_item_id, geo_target_constant_id) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - if geo_target_constant_id.nil? - geo_target_constant_id = GEO_TARGET_CONSTANT_ID - end - - resource_name = client.path.extension_feed_item(customer_id, feed_item_id) - - # Creates the update operation for extension feed item using the - # specified feed item ID and geo target constant ID for targeting. - operation = client.operation.update_resource.extension_feed_item(resource_name) do |efi| - efi.targeted_geo_target_constant = client.path.geo_target_constant(geo_target_constant_id) - end - - # Issues a mutate request to update the extension feed item. - response = client.service.extension_feed_item.mutate_extension_feed_items( - customer_id: customer_id, - operations: [operation] - ) - - # Prints the resource name of the updated extension feed item. - puts "Updated extension feed item with resource name: " \ - "'#{response.results.first.resource_name}'" -end -# [END add_geo_target] - -if __FILE__ == $0 - # Geo target constant ID for US. - GEO_TARGET_CONSTANT_ID = 2840 - - 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' - options[:feed_item_id] = 'INSERT_FEED_ITEM_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('-f', '--feed-item-id FEED-ITEM-ID', String, 'Feed Item ID') do |v| - options[:feed_item_id] = v - end - - opts.on('-g', '--geo-target-constant-id GEO-TARGET-CONSTANT-ID', String, 'Geo Target Constant ID') do |v| - options[:geo_target_constant_id] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - add_geo_target( - options.fetch(:customer_id).tr("-", ""), - options.fetch(:feed_item_id), - options[:geo_target_constant_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 - raise - end -end diff --git a/examples/extensions/add_image_extension.rb b/examples/extensions/add_image_extension.rb deleted file mode 100755 index efadd5335..000000000 --- a/examples/extensions/add_image_extension.rb +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env ruby Encoding: utf-8 -# -# Copyright 2021 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. -# -# Adds an image extension to a campaign. To create a campaign, run -# basic_operations/add_campaigns.rb. To create an image asset, run -# misc/upload_image_asset.rb. - -require 'optparse' -require 'google/ads/google_ads' -require 'date' - -def add_image_extension(customer_id, campaign_id, image_id) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - # First, create the image feed item. - operation = client.operation.create_resource.extension_feed_item do |efi| - efi.image_feed_item = client.resource.image_feed_item do |ifi| - ifi.image_asset = client.path.asset(customer_id, image_id) - end - end - - response = client.service.extension_feed_item.mutate_extension_feed_items( - customer_id: customer_id, - operations: [operation], - ) - - image_resource_name = response.results.first.resource_name - puts "Created an image extension with resource name '#{image_resource_name}'." - - # Then, create a campaign extension setting using the created image feed item. - operation = client.operation.create_resource.campaign_extension_setting do |ces| - ces.campaign = client.path.campaign(customer_id, campaign_id) - ces.extension_type = :IMAGE - ces.extension_feed_items << image_resource_name - end - - response = client.service.campaign_extension_setting.mutate_campaign_extension_settings( - customer_id: customer_id, - operations: [operation], - ) - - puts "Created a campaign extension setting with resource name '#{response.results.first.resource_name}'" -end - -if __FILE__ == $0 - 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' - options[:campaign_id] = 'INSERT_CAMPAIGN_ID_HERE' - options[:image_asset_id] = 'INSERT_IMAGE_ASSET_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('-c', '--campaign-id CAMPAIGN-ID', String, 'Campaign ID') do |v| - options[:campaign_id] = v - end - - opts.on('-I', '--image-asset-id IMAGE-ASSET-ID', String, 'Image Asset ID') do |v| - options[:image_asset_id] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - add_image_extension( - options.fetch(:customer_id).tr("-", ""), - options.fetch(:campaign_id), - options.fetch(:image_asset_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 - raise - end -end diff --git a/examples/extensions/add_sitelinks.rb b/examples/extensions/add_sitelinks.rb deleted file mode 100755 index 3ba75aad7..000000000 --- a/examples/extensions/add_sitelinks.rb +++ /dev/null @@ -1,204 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2020 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. -# -# Adds sitelinks to a campaign. To create a campaign, run add_campaigns.rb. -# DEPRECATION WARNING! -# THIS USAGE IS DEPRECATED AND WILL BE REMOVED IN AN UPCOMING API VERSION -# All extensions should migrate to Assets. See add_sitelinks_using_assets.rb. - -require 'optparse' -require 'google/ads/google_ads' -require 'date' - -# [START add_sitelinks_1] -def add_sitelinks(customer_id, campaign_id) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - campaign_resource_name = client.path.campaign(customer_id, campaign_id) - - extension_feed_items = - create_extension_feed_items(client, customer_id, campaign_resource_name) - - operation = client.operation.create_resource.campaign_extension_setting do |ces| - ces.campaign = campaign_resource_name - ces.extension_type = :SITELINK - extension_feed_items.each do |efi| - ces.extension_feed_items << efi - end - end - - response = client.service.campaign_extension_setting.mutate_campaign_extension_settings( - customer_id: customer_id, - operations: [operation], - ) - - puts "Created a campaign extension setting with resource name '#{response.results.first.resource_name}'" -end -# [END add_sitelinks_1] - -# [START add_sitelinks] -def create_extension_feed_items(client, customer_id, campaign_resource_name) - extension_feed_items = [ - client.resource.extension_feed_item do |efi| - efi.extension_type = :SITELINK - efi.sitelink_feed_item = create_sitelink_feed_item( - client, 'Store Hours', 'http://www.example.com/storehours') - efi.targeted_campaign = campaign_resource_name - end, - client.resource.extension_feed_item do |efi| - efi.extension_type = :SITELINK - efi.sitelink_feed_item = create_sitelink_feed_item( - client, 'Thanksgiving Specials', 'http://www.example.com/thanksgiving') - efi.targeted_campaign = campaign_resource_name - today = Date.today - efi.start_date_time = DateTime.new( - today.year, - today.month, - today.day, - 0, - 0, - 0 - ).strftime("%Y-%m-%d %H:%M:%S") - end_date = today + 7 - efi.end_date_time = DateTime.new( - end_date.year, - end_date.month, - end_date.day, - 23, - 59, - 59 - ).strftime("%Y-%m-%d %H:%M:%S") - - # Targets this sitelink for United States only. - # A list of country codes can be referenced here: - # https://developers.google.com/google-ads/api/reference/data/geotargets - efi.targeted_geo_target_constant = client.path.geo_target_constant(2840) - end, - client.resource.extension_feed_item do |efi| - efi.extension_type = :SITELINK - efi.sitelink_feed_item = create_sitelink_feed_item( - client, 'Wifi available', 'http://www.example.com/wifi') - efi.targeted_campaign = campaign_resource_name - efi.device = :MOBILE - efi.targeted_keyword = client.resource.keyword_info do |ki| - ki.text = 'free wifi' - ki.match_type = :BROAD - end - end, - client.resource.extension_feed_item do |efi| - efi.extension_type = :SITELINK - efi.sitelink_feed_item = create_sitelink_feed_item( - client, 'Happy hours', 'http://www.example.com/happyhours') - efi.targeted_campaign = campaign_resource_name - efi.ad_schedules << create_ad_schedule(client, :MONDAY, 18, :ZERO, 21, :ZERO) - efi.ad_schedules << create_ad_schedule(client, :TUESDAY, 18, :ZERO, 21, :ZERO) - efi.ad_schedules << create_ad_schedule(client, :WEDNESDAY, 18, :ZERO, 21, :ZERO) - efi.ad_schedules << create_ad_schedule(client, :THURSDAY, 18, :ZERO, 21, :ZERO) - efi.ad_schedules << create_ad_schedule(client, :FRIDAY, 18, :ZERO, 21, :ZERO) - end - ] - - operations = extension_feed_items.map do |efi| - client.operation.create_resource.extension_feed_item(efi) - end - - response = client.service.extension_feed_item.mutate_extension_feed_items( - customer_id: customer_id, - operations: operations, - ) - - puts "Created #{response.results.size} extension feed items with the following resource names:" - response.results.map do |result| - puts "\t#{result.resource_name}" - result.resource_name - end -end -# [END add_sitelinks] - -def create_sitelink_feed_item(client, sitelink_text, sitelink_url) - client.resource.sitelink_feed_item do |sfi| - sfi.link_text = sitelink_text - sfi.final_urls << sitelink_url - end -end - -def create_ad_schedule(client, day, start_hour, start_minute, end_hour, end_minute) - client.resource.ad_schedule_info do |asi| - asi.day_of_week = day - asi.start_hour = start_hour - asi.start_minute = start_minute - asi.end_hour = end_hour - asi.end_minute = end_minute - end -end - -if __FILE__ == $0 - 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' - options[:campaign_id] = 'INSERT_CAMPAIGN_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('-c', '--campaign-id CAMPAIGN-ID', String, 'Campaign ID') do |v| - options[:campaign_id] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - add_sitelinks(options.fetch(:customer_id).tr("-", ""), options.fetch(:campaign_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 - raise - end -end diff --git a/examples/extensions/migrate_promotion_feed_to_asset.rb b/examples/extensions/migrate_promotion_feed_to_asset.rb deleted file mode 100644 index 431968890..000000000 --- a/examples/extensions/migrate_promotion_feed_to_asset.rb +++ /dev/null @@ -1,368 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2021 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 code example retrieves the full details of a Promotion Feed-based extension and -# creates a matching Promotion asset-based extension. The new Asset-based extension will -# then be associated with the same campaigns and ad groups as the original Feed-based -# extension. -# -# Once copied, you should remove the Feed-based extension; see -# remove_entire_sitelink_campaign_extension_setting.rb.cs for an example. - -require 'optparse' -require 'google/ads/google_ads' - -def migrate_promotion_feed_to_asset(customer_id, feed_item_id) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - resource_name = client.path.extension_feed_item(customer_id, feed_item_id) - - # Get the target extension feed item. - extension_feed_item = get_extension_feed_item(client, customer_id, feed_item_id) - - # Get all campaign IDs associated with the extension feed item. - campaign_ids = get_targeted_campaign_ids(client, customer_id, resource_name) - - # Get all ad group IDs associated with the extension feed item. - ad_group_ids = get_targeted_ad_group_ids(client, customer_id, resource_name) - - # Create a new Promotion asset that matches the target extension feed item. - promotion_asset_resource_name = create_promotion_asset_from_feed(client, customer_id, extension_feed_item) - - # Associate the new Promotion asset with the same campaigns as the original. - associate_asset_with_campaigns(client, customer_id, promotion_asset_resource_name, campaign_ids) - - # Associate the new Promotion asset with the same ad groups as the original. - associate_asset_with_ad_groups(client, customer_id, promotion_asset_resource_name, ad_group_ids) -end - -def get_extension_feed_item(client, customer_id, feed_item_id) - # Gets the requested Promotion-type extension feed item. - # - # Note that extension feed items pertain to feeds that were created by Google. Use - # FeedService to instead retrieve a user-created Feed. - - google_ads_service = client.service.google_ads - - query = <<~QUERY - SELECT - extension_feed_item.id, - extension_feed_item.ad_schedules, - extension_feed_item.device, - extension_feed_item.status, - extension_feed_item.start_date_time, - extension_feed_item.end_date_time, - extension_feed_item.targeted_campaign, - extension_feed_item.targeted_ad_group, - extension_feed_item.promotion_feed_item.discount_modifier, - extension_feed_item.promotion_feed_item.final_mobile_urls, - extension_feed_item.promotion_feed_item.final_url_suffix, - extension_feed_item.promotion_feed_item.final_urls, - extension_feed_item.promotion_feed_item.language_code, - extension_feed_item.promotion_feed_item.money_amount_off.amount_micros, - extension_feed_item.promotion_feed_item.money_amount_off.currency_code, - extension_feed_item.promotion_feed_item.occasion, - extension_feed_item.promotion_feed_item.orders_over_amount.amount_micros, - extension_feed_item.promotion_feed_item.orders_over_amount.currency_code, - extension_feed_item.promotion_feed_item.percent_off, - extension_feed_item.promotion_feed_item.promotion_code, - extension_feed_item.promotion_feed_item.promotion_end_date, - extension_feed_item.promotion_feed_item.promotion_start_date, - extension_feed_item.promotion_feed_item.promotion_target, - extension_feed_item.promotion_feed_item.tracking_url_template - FROM extension_feed_item - WHERE - extension_feed_item.extension_type = 'PROMOTION' - AND extension_feed_item.id = #{feed_item_id} - LIMIT 1 - QUERY - - # Issue a search request to get the extension feed item contents. - response = google_ads_service.search(customer_id: customer_id, query: query) - extension_feed_item = response.first&.extension_feed_item - - if extension_feed_item.nil? - raise "Error: No ExtensionFeedItem found with ID '#{feed_item_id}'." - end - - puts "Retrieved details for ad extension with ID '#{extension_feed_item.id}'." - - # Create a query to retrieve any URL customer parameters attached to the - # extension feed item. - query = <<~QUERY - SELECT feed_item.url_custom_parameters - FROM feed_item - WHERE feed_item.id = #{extension_feed_item.id} - LIMIT 1 - QUERY - - # Issue a search request to get any URL custom parameters. - response = google_ads_service.search(customer_id: customer_id, query: query) - feed_item = response.first&.feed_item - - if feed_item.nil? - raise "Error: No FeedItem found with ID '#{feed_item_id}'." - end - - parameters = feed_item.url_custom_parameters - - puts "Retrieved #{parameters.count} attached URL custom parameters." - - extension_feed_item.promotion_feed_item.url_custom_parameters += parameters - - extension_feed_item -end - -# [START migrate_promotion_feed_to_asset_1] -def get_targeted_campaign_ids(client, customer_id, resource_name) - # Finds and returns all of the campaigns that are associated with the specified - # Promotion extension feed item. - - query = <<~QUERY - SELECT - campaign.id, - campaign_extension_setting.extension_feed_items - FROM campaign_extension_setting - WHERE - campaign_extension_setting.extension_type = 'PROMOTION' - AND campaign.status != 'REMOVED' - QUERY - - responses = client.service.google_ads.search_stream(customer_id: customer_id, query: query) - - campaign_ids = [] - - responses.each do |response| - response.results.each do |row| - feed_items = row.campaign_extension_setting.extension_feed_items - if feed_items.include?(resource_name) - puts "Found matching campaign with ID '#{row.campaign.id}'." - campaign_ids << row.campaign.id - end - end - end - - campaign_ids -end -# [END migrate_promotion_feed_to_asset_1] - -def get_targeted_ad_group_ids(client, customer_id, resource_name) - # Finds and returns all of the ad groups that are associated with the specified - # Promotion extension feed item. - - query = <<~QUERY - SELECT - ad_group.id, - ad_group_extension_setting.extension_feed_items - FROM ad_group_extension_setting - WHERE - ad_group_extension_setting.extension_type = 'PROMOTION' - AND ad_group.status != 'REMOVED' - QUERY - - responses = client.service.google_ads.search_stream(customer_id: customer_id, query: query) - - ad_group_ids = [] - - responses.each do |response| - response.results.each do |row| - feed_items = row.ad_group_extension_setting.extension_feed_items - if feed_items.include?(resource_name) - puts "Found matching ad group with ID: '#{row.ad_group.id}'" - ad_group_ids << row.ad_group.id - end - end - end - - ad_group_ids -end - -# [START migrate_promotion_feed_to_asset] -def create_promotion_asset_from_feed(client, customer_id, extension_feed_item) - # Create a Promotion asset that copies values from the specified extension feed item. - - asset_service = client.service.asset - promotion_feed_item = extension_feed_item.promotion_feed_item - - # Create an asset operation to start building the new promotion asset using - # data from the given extension feed item. - asset_operation = client.operation.create_resource.asset do |asset| - asset.name = "Migrated from feed item ID '#{extension_feed_item.id}'" - asset.tracking_url_template = promotion_feed_item.tracking_url_template - asset.final_url_suffix = promotion_feed_item.final_url_suffix - asset.final_urls += promotion_feed_item.final_urls - asset.final_mobile_urls += promotion_feed_item.final_mobile_urls - - # Create the Promotion asset. - asset.promotion_asset = client.resource.promotion_asset do |pa| - pa.promotion_target = promotion_feed_item.promotion_target - pa.discount_modifier = promotion_feed_item.discount_modifier - pa.redemption_start_date = promotion_feed_item.promotion_start_date - pa.redemption_end_date = promotion_feed_item.promotion_end_date - pa.occasion = promotion_feed_item.occasion - pa.language_code = promotion_feed_item.language_code - pa.ad_schedule_targets += extension_feed_item.ad_schedules - - # Either percent_off or money_amount_off must be set. - if promotion_feed_item.percent_off.positive? - # Adjust the percent off scale after copying. - pa.percent_off = int(promotion_feed_item.percent_off / 100) - else - # If percent_off is not set then copy money_amount_off. This field is - # an instance of Money in both cases, so setting the field with - # copy_from is possible. Using regular assignment is also valid here. - pa.money_amount_off = promotion_feed_item.money_amount_off - end - - # Either promotion_code or orders_over_amount must be set. - if promotion_feed_item.promotion_code.empty? - pa.orders_over_amount = promotion_feed_item.orders_over_amount - else - pa.promotion_code = promotion_feed_item.promotion_code - end - - # Set the start and end dates if set in the existing extension. - unless promotion_feed_item.promotion_start_date.empty? - pa.start_date = promotion_feed_item.promotion_start_date - end - - unless promotion_feed_item.promotion_end_date.empty? - pa.end_date = promotion_feed_item.promotion_end_date - end - end - end - - response = asset_service.mutate_assets(customer_id: customer_id, operations: [asset_operation]) - resource_name = response.results.first.resource_name - puts "Created promotion asset with resource name: '#{resource_name}'" - - resource_name -end -# [END migrate_promotion_feed_to_asset] - -# [START migrate_promotion_feed_to_asset_2] -def associate_asset_with_campaigns(client, customer_id, promotion_asset_resource_name, campaign_ids) - # Associates the specified promotion asset with the specified campaigns. - - if campaign_ids.empty? - puts 'Asset was not associated with any campaigns.' - return - end - - operations = campaign_ids.map do |campaign_id| - client.operation.create_resource.campaign_asset do |ca| - ca.asset = promotion_asset_resource_name - ca.field_type = :PROMOTION - ca.campaign = client.path.campaign(customer_id, campaign_id) - end - end - - response = client.service.campaign_asset.mutate_campaign_assets( - customer_id: customer_id, - operations: operations, - ) - - response.results.each do |result| - puts "Created campaign asset with resource name '#{result.resource_name}'." - end -end -# [END migrate_promotion_feed_to_asset_2] - -def associate_asset_with_ad_groups(client, customer_id, promotion_asset_resource_name, ad_group_ids) - # Associates the specified promotion asset with the specified ad groups. - - if ad_group_ids.empty? - puts 'Asset was not associated with any ad groups.' - return - end - - operations = ad_group_ids.map do |ad_group_id| - client.operation.create_resource.ad_group_asset do |aga| - aga.asset = promotion_asset_resource_name - aga.field_type = :PROMOTION - aga.ad_group = client.path.ad_group(customer_id, ad_group_id) - end - end - - response = client.service.ad_group_asset.mutate_ad_group_assets( - customer_id: customer_id, - operations: operations, - ) - - response.results.each do |result| - puts "Created ad group asset with resource name '#{result.resource_name}'." - end -end - -if __FILE__ == $0 - 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' - options[:feed_item_id] = 'INSERT_FEED_ITEM_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('-f', '--feed-item-id FEED-ITEM-ID', String, 'Feed Item ID') do |v| - options[:feed_item_id] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - migrate_promotion_feed_to_asset(options.fetch(:customer_id).tr('-', ''), options.fetch(:feed_item_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 - raise - end -end diff --git a/examples/extensions/remove_entire_sitelink_campaign_extension_setting.rb b/examples/extensions/remove_entire_sitelink_campaign_extension_setting.rb deleted file mode 100755 index c0aa27a5c..000000000 --- a/examples/extensions/remove_entire_sitelink_campaign_extension_setting.rb +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2020 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. -# -# Removes the entire sitelink campaign extension setting by removing both the -# sitelink campaign extension setting itself and its associated sitelink -# extension feed items. This requires two steps, since removing the campaign -# extension setting doesn't automatically remove its extension feed items. -# -# To make this example work with other types of extensions, find -# `ExtensionType::SITELINK` and replace it with the extension type you wish to -# remove. - -require 'optparse' -require 'google/ads/google_ads' -require 'date' - -# [START remove_entire_sitelink_campaign_extension_setting] -def remove_entire_sitelink_campaign_extension_setting(customer_id, campaign_id) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - mutate_operations = [] - - # Creates a mutate operation that contains the campaign extension setting - # operation to remove the specified sitelink campaign extension setting. - mutate_operations << create_sitelink_campaign_extension_setting_mutate_operation( - client, - customer_id, - campaign_id, - ) - - # Gets all sitelink extension feed items of the specified campaign. - google_ads_service = client.service.google_ads - extension_feed_item_resource_names = get_all_sitelink_extension_feed_items( - client, - google_ads_service, - customer_id, - campaign_id, - ) - - # Creates mutate operations, each of which contains an extension feed item - # operation to remove the specified extension feed items. - mutate_operations += create_extension_feed_item_mutate_operations( - client, - extension_feed_item_resource_names, - ) - - # Issues a mutate request to remove the campaign extension setting and its - # extension feed items. - response = google_ads_service.mutate( - customer_id: customer_id, - mutate_operations: mutate_operations, - ) - mutate_operation_responses = response.mutate_operation_responses - - # Prints the information on the removed campaign extension setting and its - # extension feed items. - # Each mutate operation response is returned in the same order as we passed - # its corresponding operation. Therefore, the first belongs to the campaign - # setting operation, and the rest belong to the extension feed item operations. - puts "Removed a campaign extension setting with resource name: " \ - "#{mutate_operation_responses[0].campaign_extension_setting_result.resource_name}" - for i in 1..mutate_operation_responses.size - 1 - puts "Removed an extension feed item with resource name: " \ - "#{mutate_operation_responses[i].extension_feed_item_result.resource_name}" - end -end -# [END remove_entire_sitelink_campaign_extension_setting] - -# Creates a mutate operation for the sitelink campaign extension setting that -# will be removed. -def create_sitelink_campaign_extension_setting_mutate_operation( - client, - customer_id, - campaign_id -) - # Creates a mutate operation for the campaign extension setting operation. - mutate_op = client.operation.mutate - mutate_op.campaign_extension_setting_operation = \ - client.operation.remove_resource.campaign_extension_setting( - client.path.campaign_extension_setting( - customer_id, campaign_id, :SITELINK)) - mutate_op -end - -# Returns all sitelink extension feed items associated to the specified -# campaign extension setting. -# [START remove_entire_sitelink_campaign_extension_setting_1] -def get_all_sitelink_extension_feed_items( - client, - google_ads_service, - customer_id, - campaign_id -) - # Creates a query that retrieves all campaigns. - query = <<~QUERY - SELECT campaign_extension_setting.campaign, - campaign_extension_setting.extension_type, - campaign_extension_setting.extension_feed_items - FROM campaign_extension_setting - WHERE campaign_extension_setting.campaign = '#{client.path.campaign(customer_id, campaign_id)}' - AND campaign_extension_setting.extension_type = 'SITELINK' - QUERY - - # Issues a search stream request - stream = google_ads_service.search_stream( - customer_id: customer_id, - query: query, - ) - - extension_feed_item_resource_names = [] - # Iterates over all rows in all messages and prints the requested field values - # for the campaign extension setting in each row. - stream.each do |response| - response.results.each do |row| - extension_feed_items = row.campaign_extension_setting.extension_feed_items - extension_feed_items.each do |item| - extension_feed_item_resource_names << item - puts "Extension feed item with resource name #{item} was found." - end - end - end - extension_feed_item_resource_names -end -# [END remove_entire_sitelink_campaign_extension_setting_1] - -# Creates mutate operations for the sitelink extension feed items that will be -# removed. -def create_extension_feed_item_mutate_operations( - client, - extension_feed_item_resource_names -) - mutate_operations = [] - extension_feed_item_resource_names.each do |resource_name| - # Creates a mutate operation to remove the extension feed item. - mutate_op = client.operation.mutate - mutate_op.extension_feed_item_operation = \ - client.operation.remove_resource.extension_feed_item(resource_name) - mutate_operations << mutate_op - end - mutate_operations -end - -if __FILE__ == $0 - 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' - options[:campaign_id] = 'INSERT_CAMPAIGN_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('-c', '--campaign-id CAMPAIGN-ID', String, 'Campaign ID') do |v| - options[:campaign_id] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - remove_entire_sitelink_campaign_extension_setting( - options.fetch(:customer_id).tr("-", ""), - options.fetch(:campaign_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 - raise - end -end diff --git a/examples/extensions/update_sitelink.rb b/examples/extensions/update_sitelink.rb deleted file mode 100755 index 78ede9d84..000000000 --- a/examples/extensions/update_sitelink.rb +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2020 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. -# -# Updates the sitelink extension feed item with the specified link text. - -require 'optparse' -require 'google/ads/google_ads' - -def update_sitelink(customer_id, feed_item_id, sitelink_text) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - # [START update_sitelink] - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - operation = client.operation.update_resource.extension_feed_item( - client.path.extension_feed_item(customer_id, feed_item_id) - ) do |efi| - efi.sitelink_feed_item = client.resource.sitelink_feed_item do |sitelink| - sitelink.link_text = sitelink_text - end - end - - response = client.service.extension_feed_item.mutate_extension_feed_items( - customer_id: customer_id, - operations: [operation], - ) - # [END update_sitelink] - - puts "Updated extension feed item with resource name " \ - "'#{response.results.first.resource_name}'." -end - -if __FILE__ == $0 - 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' - options[:feed_item_id] = 'INSERT_FEED_ITEM_ID_HERE' - options[:sitelink_text] = 'INSERT_SITELINK_TEXT_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('-f', '--feed-item-id FEED-ITEM-ID', String, 'Feed Item ID') do |v| - options[:feed_item_id] = v - end - - opts.on('-s', '--sitelink-text SITELINK-TEXT', String, 'Sitelink Text') do |v| - options[:sitelink_text] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - update_sitelink( - options.fetch(:customer_id).tr("-", ""), - options.fetch(:feed_item_id), - options[:sitelink_text], - ) - 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 - raise - end -end diff --git a/examples/extensions/update_sitelink_campaign_extension_setting.rb b/examples/extensions/update_sitelink_campaign_extension_setting.rb deleted file mode 100755 index a941790eb..000000000 --- a/examples/extensions/update_sitelink_campaign_extension_setting.rb +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2021 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. -# -# Updates the sitelink campaign extension setting. - -# Replaces the extension feed items of the sitelink campaign extension setting -# with the given feed item IDs. Note that this doesn't completely remove your -# old extension feed items. See -# https://developers.google.com/google-ads/api/docs/extensions/extension-settings/overview -# for details. - -require 'optparse' -require 'google/ads/google_ads' - -# [START update_sitelink_campaign_extension_setting] -def update_sitelink_campaign_extension_setting(customer_id, campaign_id, feed_item_ids) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - # Replace the current extension feed items with the given list - operation = client.operation.update_resource.campaign_extension_setting( - client.path.campaign_extension_setting( - customer_id: customer_id, - campaign_id: campaign_id, - extension_type: :SITELINK - ) - ) do |ces| - feed_item_ids.each do |feed_item_id| - # Transforms the specified feed item IDs to resource names as required by the API. - ces.extension_feed_items << client.path.extension_feed_item(customer_id, feed_item_id) - end - end - - # Update the campaign extension settings - response = client.service.campaign_extension_setting.mutate_campaign_extension_settings( - customer_id: customer_id, - operations: [operation], - ) - - puts "Updated campaign extension setting with resource name: " \ - "'#{response.results.first.resource_name}'." -end -# [END update_sitelink_campaign_extension_setting] - -if __FILE__ == $0 - 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' - options[:campaign_id] = 'INSERT_CAMPAIGN_ID_HERE' - options[:feed_item_ids] = 'INSERT_FEED_ITEM_IDS_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('-s', '--campaign-id CAMPAIGN-ID', String, 'Campaign ID') do |v| - options[:campaign_id] = v - end - - opts.on('-f', '--feed-item-ids FEED-ITEM-IDS', String, 'Comma separated list of Feed Item IDs') do |v| - options[:feed_item_ids] = v - end - - opts.separator '' - opts.separator 'Help:' - - opts.on_tail('-h', '--help', 'Show this message') do - puts opts - exit - end - end.parse! - - begin - update_sitelink_campaign_extension_setting( - options.fetch(:customer_id).tr("-", ""), - options.fetch(:campaign_id), - options.fetch(:feed_item_ids).split(",").map(&:strip), - ) - 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 - raise - end -end diff --git a/examples/misc/upload_image.rb b/examples/misc/upload_image.rb deleted file mode 100644 index 3685b9cb5..000000000 --- a/examples/misc/upload_image.rb +++ /dev/null @@ -1,104 +0,0 @@ -#!/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 uploads an image - -# NOTE: This code example uses version v14 of the Google Ads API. -# Google Ads is migrating from individual media files to assets, -# and version v15 of the API removed support for -# MediaFileService as part of this migration. Once your Ads account is migrated, this code -# example will stop working, and you should use upload_image_asset.rb instead. This code -# example will be removed once the migration completes. -# See https://ads-developers.googleblog.com/2023/07/image-and-location-auto-migration.html -# for more details. - -require 'optparse' -require 'google/ads/google_ads' -require 'open-uri' - -def upload_image(customer_id) - image_data = URI.open("https://gaagl.page.link/Eit5") { |f| f.read } - - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - operation = client.operation.v14.create_resource.media_file do |media_file| - media_file.type = :IMAGE - media_file.image = client.resource.v14.media_image do |media_image| - media_image.data = image_data - end - end - - media_file_service = client.service.v14.media_file - response = media_file_service.mutate_media_files( - customer_id: customer_id, - operations: [operation], - ) - - puts("Uploaded media file with id: #{response.results.first.resource_name}") -end - -if __FILE__ == $0 - 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 - upload_image(options.fetch(:customer_id).tr("-", "")) - 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 - raise - end -end diff --git a/examples/misc/upload_media_bundle.rb b/examples/misc/upload_media_bundle.rb deleted file mode 100755 index aefd0fb78..000000000 --- a/examples/misc/upload_media_bundle.rb +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright 2020 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 uploads an HTML5 zip file as a media bundle. - -# NOTE: This code example uses version v14 of the Google Ads API. -# Google Ads is migrating from individual media files to assets, -# and version v15 of the API removed support for -# MediaFileService as part of this migration. -# See https://ads-developers.googleblog.com/2023/07/image-and-location-auto-migration.html -# for more details. - -require 'optparse' -require 'google/ads/google_ads' -require 'open-uri' - -def upload_media_bundle(customer_id) - # GoogleAdsClient will read a config file from - # ENV['HOME']/google_ads_config.rb when called without parameters - client = Google::Ads::GoogleAds::GoogleAdsClient.new - - url = 'https://gaagl.page.link/ib87' - bundle_content = URI.open(url) { |f| f.read } - - # Creates a media file containing the bundle content. - operation = client.operation.v14.create_resource.media_file do |media| - media.name = 'Ad Media Bundle' - media.type = :MEDIA_BUNDLE - media.media_bundle = client.resource.v14.media_bundle do |bundle| - bundle.data = bundle_content - end - end - - # Issues a mutate request to add the media file. - response = client.service.v14.media_file.mutate_media_files( - customer_id: customer_id, - operations: [operation], - ) - - puts "The media bundle with resource name " \ - "#{response.results.first.resource_name} was added." -end - -if __FILE__ == $0 - 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 - upload_media_bundle(options.fetch(:customer_id).tr('-', '')) - 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 - raise - end -end diff --git a/lib/google/ads/google_ads/api_versions.rb b/lib/google/ads/google_ads/api_versions.rb index e107a5b05..95ca8dc7d 100644 --- a/lib/google/ads/google_ads/api_versions.rb +++ b/lib/google/ads/google_ads/api_versions.rb @@ -1,8 +1,8 @@ module Google module Ads module GoogleAds - KNOWN_API_VERSIONS = [:V14, :V15] - DEFAULT_API_VERSION = :V15 + KNOWN_API_VERSIONS = [:V14, :V15, :V16] + DEFAULT_API_VERSION = :V16 def self.default_api_version DEFAULT_API_VERSION diff --git a/lib/google/ads/google_ads/utils/v16/path_lookup_util.rb b/lib/google/ads/google_ads/utils/v16/path_lookup_util.rb new file mode 100644 index 000000000..1918035c4 --- /dev/null +++ b/lib/google/ads/google_ads/utils/v16/path_lookup_util.rb @@ -0,0 +1,31 @@ +# Encoding: utf-8 +# +# Copyright 2022 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. +# +# Utility that generates up resource names for entities given IDs. + +require "google/ads/google_ads/utils/build_path_lookup_class" + +module Google + module Ads + module GoogleAds + module Utils + module V16 + PathLookupUtil = Utils.build_path_lookup_class(:v16) + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/ad_asset_pb.rb b/lib/google/ads/google_ads/v16/common/ad_asset_pb.rb new file mode 100644 index 000000000..a93f01ab6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/ad_asset_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/ad_asset.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/asset_policy_pb' +require 'google/ads/google_ads/v16/enums/asset_performance_label_pb' +require 'google/ads/google_ads/v16/enums/served_asset_field_type_pb' + + +descriptor_data = "\n.google/ads/googleads/v16/common/ad_asset.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x32google/ads/googleads/v16/common/asset_policy.proto\x1a\n\x06\x66ields\x18\x08 \x03(\x0b\x32..google.ads.googleads.v16.common.LeadFormField\x12\\\n\x16\x63ustom_question_fields\x18\x17 \x03(\x0b\x32<.google.ads.googleads.v16.common.LeadFormCustomQuestionField\x12Q\n\x10\x64\x65livery_methods\x18\t \x03(\x0b\x32\x37.google.ads.googleads.v16.common.LeadFormDeliveryMethod\x12\x92\x01\n\x1fpost_submit_call_to_action_type\x18\x13 \x01(\x0e\x32i.google.ads.googleads.v16.enums.LeadFormPostSubmitCallToActionTypeEnum.LeadFormPostSubmitCallToActionType\x12#\n\x16\x62\x61\x63kground_image_asset\x18\x14 \x01(\tH\x02\x88\x01\x01\x12g\n\x0e\x64\x65sired_intent\x18\x15 \x01(\x0e\x32O.google.ads.googleads.v16.enums.LeadFormDesiredIntentEnum.LeadFormDesiredIntent\x12\x1e\n\x11\x63ustom_disclosure\x18\x16 \x01(\tH\x03\x88\x01\x01\x42\x17\n\x15_post_submit_headlineB\x1a\n\x18_post_submit_descriptionB\x19\n\x17_background_image_assetB\x14\n\x12_custom_disclosure\"\x87\x02\n\rLeadFormField\x12m\n\ninput_type\x18\x01 \x01(\x0e\x32Y.google.ads.googleads.v16.enums.LeadFormFieldUserInputTypeEnum.LeadFormFieldUserInputType\x12]\n\x15single_choice_answers\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.common.LeadFormSingleChoiceAnswersH\x00\x12\x1d\n\x13has_location_answer\x18\x03 \x01(\x08H\x00\x42\t\n\x07\x61nswers\"\xc4\x01\n\x1bLeadFormCustomQuestionField\x12\x1c\n\x14\x63ustom_question_text\x18\x01 \x01(\t\x12]\n\x15single_choice_answers\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.common.LeadFormSingleChoiceAnswersH\x00\x12\x1d\n\x13has_location_answer\x18\x03 \x01(\x08H\x00\x42\t\n\x07\x61nswers\".\n\x1bLeadFormSingleChoiceAnswers\x12\x0f\n\x07\x61nswers\x18\x01 \x03(\t\"q\n\x16LeadFormDeliveryMethod\x12\x43\n\x07webhook\x18\x01 \x01(\x0b\x32\x30.google.ads.googleads.v16.common.WebhookDeliveryH\x00\x42\x12\n\x10\x64\x65livery_details\"\xbf\x01\n\x0fWebhookDelivery\x12#\n\x16\x61\x64vertiser_webhook_url\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rgoogle_secret\x18\x05 \x01(\tH\x01\x88\x01\x01\x12#\n\x16payload_schema_version\x18\x06 \x01(\x03H\x02\x88\x01\x01\x42\x19\n\x17_advertiser_webhook_urlB\x10\n\x0e_google_secretB\x19\n\x17_payload_schema_version\"\x13\n\x11\x42ookOnGoogleAsset\"\xcb\x05\n\x0ePromotionAsset\x12\x1d\n\x10promotion_target\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x84\x01\n\x11\x64iscount_modifier\x18\x02 \x01(\x0e\x32i.google.ads.googleads.v16.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier\x12\x1d\n\x15redemption_start_date\x18\x07 \x01(\t\x12\x1b\n\x13redemption_end_date\x18\x08 \x01(\t\x12k\n\x08occasion\x18\t \x01(\x0e\x32Y.google.ads.googleads.v16.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion\x12\x15\n\rlanguage_code\x18\n \x01(\t\x12\x12\n\nstart_date\x18\x0b \x01(\t\x12\x10\n\x08\x65nd_date\x18\x0c \x01(\t\x12L\n\x13\x61\x64_schedule_targets\x18\r \x03(\x0b\x32/.google.ads.googleads.v16.common.AdScheduleInfo\x12\x15\n\x0bpercent_off\x18\x03 \x01(\x03H\x00\x12\x42\n\x10money_amount_off\x18\x04 \x01(\x0b\x32&.google.ads.googleads.v16.common.MoneyH\x00\x12\x18\n\x0epromotion_code\x18\x05 \x01(\tH\x01\x12\x44\n\x12orders_over_amount\x18\x06 \x01(\x0b\x32&.google.ads.googleads.v16.common.MoneyH\x01\x42\x0f\n\rdiscount_typeB\x13\n\x11promotion_trigger\"\x9d\x01\n\x0c\x43\x61lloutAsset\x12\x19\n\x0c\x63\x61llout_text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nstart_date\x18\x02 \x01(\t\x12\x10\n\x08\x65nd_date\x18\x03 \x01(\t\x12L\n\x13\x61\x64_schedule_targets\x18\x04 \x03(\x0b\x32/.google.ads.googleads.v16.common.AdScheduleInfo\"B\n\x16StructuredSnippetAsset\x12\x13\n\x06header\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06values\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xc7\x01\n\rSitelinkAsset\x12\x16\n\tlink_text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64\x65scription1\x18\x02 \x01(\t\x12\x14\n\x0c\x64\x65scription2\x18\x03 \x01(\t\x12\x12\n\nstart_date\x18\x04 \x01(\t\x12\x10\n\x08\x65nd_date\x18\x05 \x01(\t\x12L\n\x13\x61\x64_schedule_targets\x18\x06 \x03(\x0b\x32/.google.ads.googleads.v16.common.AdScheduleInfo\"6\n\rPageFeedAsset\x12\x15\n\x08page_url\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06labels\x18\x02 \x03(\t\"\xe8\x02\n\x15\x44ynamicEducationAsset\x12\x17\n\nprogram_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0blocation_id\x18\x02 \x01(\t\x12\x19\n\x0cprogram_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07subject\x18\x04 \x01(\t\x12\x1b\n\x13program_description\x18\x05 \x01(\t\x12\x13\n\x0bschool_name\x18\x06 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x07 \x01(\t\x12\x1b\n\x13\x63ontextual_keywords\x18\x08 \x03(\t\x12\x18\n\x10\x61ndroid_app_link\x18\t \x01(\t\x12\x1b\n\x13similar_program_ids\x18\n \x03(\t\x12\x14\n\x0cios_app_link\x18\x0b \x01(\t\x12\x18\n\x10ios_app_store_id\x18\x0c \x01(\x03\x12\x1b\n\x13thumbnail_image_url\x18\r \x01(\t\x12\x11\n\timage_url\x18\x0e \x01(\t\"\xc0\x01\n\x0eMobileAppAsset\x12\x13\n\x06\x61pp_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12[\n\tapp_store\x18\x02 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.MobileAppVendorEnum.MobileAppVendorB\x03\xe0\x41\x02\x12\x16\n\tlink_text\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nstart_date\x18\x04 \x01(\t\x12\x10\n\x08\x65nd_date\x18\x05 \x01(\t\"B\n\x11HotelCalloutAsset\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xe8\x02\n\tCallAsset\x12\x19\n\x0c\x63ountry_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cphone_number\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x86\x01\n\x1f\x63\x61ll_conversion_reporting_state\x18\x03 \x01(\x0e\x32].google.ads.googleads.v16.enums.CallConversionReportingStateEnum.CallConversionReportingState\x12N\n\x16\x63\x61ll_conversion_action\x18\x04 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/ConversionAction\x12L\n\x13\x61\x64_schedule_targets\x18\x05 \x03(\x0b\x32/.google.ads.googleads.v16.common.AdScheduleInfo\"\xc7\x02\n\nPriceAsset\x12\\\n\x04type\x18\x01 \x01(\x0e\x32I.google.ads.googleads.v16.enums.PriceExtensionTypeEnum.PriceExtensionTypeB\x03\xe0\x41\x02\x12v\n\x0fprice_qualifier\x18\x02 \x01(\x0e\x32].google.ads.googleads.v16.enums.PriceExtensionPriceQualifierEnum.PriceExtensionPriceQualifier\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0fprice_offerings\x18\x04 \x03(\x0b\x32..google.ads.googleads.v16.common.PriceOffering\"\x8f\x02\n\rPriceOffering\x12\x13\n\x06header\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x05price\x18\x03 \x01(\x0b\x32&.google.ads.googleads.v16.common.MoneyB\x03\xe0\x41\x02\x12\x61\n\x04unit\x18\x04 \x01(\x0e\x32S.google.ads.googleads.v16.enums.PriceExtensionPriceUnitEnum.PriceExtensionPriceUnit\x12\x16\n\tfinal_url\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x10\x66inal_mobile_url\x18\x06 \x01(\t\"r\n\x11\x43\x61llToActionAsset\x12]\n\x0e\x63\x61ll_to_action\x18\x01 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.CallToActionTypeEnum.CallToActionType\"\xf1\x02\n\x16\x44ynamicRealEstateAsset\x12\x17\n\nlisting_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0clisting_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tcity_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x05 \x01(\t\x12\r\n\x05price\x18\x06 \x01(\t\x12\x11\n\timage_url\x18\x07 \x01(\t\x12\x15\n\rproperty_type\x18\x08 \x01(\t\x12\x14\n\x0clisting_type\x18\t \x01(\t\x12\x1b\n\x13\x63ontextual_keywords\x18\n \x03(\t\x12\x17\n\x0f\x66ormatted_price\x18\x0b \x01(\t\x12\x18\n\x10\x61ndroid_app_link\x18\x0c \x01(\t\x12\x14\n\x0cios_app_link\x18\r \x01(\t\x12\x18\n\x10ios_app_store_id\x18\x0e \x01(\x03\x12\x1b\n\x13similar_listing_ids\x18\x0f \x03(\t\"\x92\x03\n\x12\x44ynamicCustomAsset\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0b\n\x03id2\x18\x02 \x01(\t\x12\x17\n\nitem_title\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\ritem_subtitle\x18\x04 \x01(\t\x12\x18\n\x10item_description\x18\x05 \x01(\t\x12\x14\n\x0citem_address\x18\x06 \x01(\t\x12\x15\n\ritem_category\x18\x07 \x01(\t\x12\r\n\x05price\x18\x08 \x01(\t\x12\x12\n\nsale_price\x18\t \x01(\t\x12\x17\n\x0f\x66ormatted_price\x18\n \x01(\t\x12\x1c\n\x14\x66ormatted_sale_price\x18\x0b \x01(\t\x12\x11\n\timage_url\x18\x0c \x01(\t\x12\x1b\n\x13\x63ontextual_keywords\x18\r \x03(\t\x12\x18\n\x10\x61ndroid_app_link\x18\x0e \x01(\t\x12\x14\n\x0cios_app_link\x18\x10 \x01(\t\x12\x18\n\x10ios_app_store_id\x18\x11 \x01(\x03\x12\x13\n\x0bsimilar_ids\x18\x0f \x03(\t\"\xad\x03\n\x1c\x44ynamicHotelsAndRentalsAsset\x12\x18\n\x0bproperty_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rproperty_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\timage_url\x18\x03 \x01(\t\x12\x18\n\x10\x64\x65stination_name\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\r\n\x05price\x18\x06 \x01(\t\x12\x12\n\nsale_price\x18\x07 \x01(\t\x12\x13\n\x0bstar_rating\x18\x08 \x01(\x03\x12\x10\n\x08\x63\x61tegory\x18\t \x01(\t\x12\x1b\n\x13\x63ontextual_keywords\x18\n \x03(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x0b \x01(\t\x12\x18\n\x10\x61ndroid_app_link\x18\x0c \x01(\t\x12\x14\n\x0cios_app_link\x18\r \x01(\t\x12\x18\n\x10ios_app_store_id\x18\x0e \x01(\x03\x12\x17\n\x0f\x66ormatted_price\x18\x0f \x01(\t\x12\x1c\n\x14\x66ormatted_sale_price\x18\x10 \x01(\t\x12\x1c\n\x14similar_property_ids\x18\x11 \x03(\t\"\x93\x03\n\x13\x44ynamicFlightsAsset\x12\x1b\n\x0e\x64\x65stination_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\torigin_id\x18\x02 \x01(\t\x12\x1f\n\x12\x66light_description\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\timage_url\x18\x04 \x01(\t\x12\x18\n\x10\x64\x65stination_name\x18\x05 \x01(\t\x12\x13\n\x0borigin_name\x18\x06 \x01(\t\x12\x14\n\x0c\x66light_price\x18\x07 \x01(\t\x12\x19\n\x11\x66light_sale_price\x18\x08 \x01(\t\x12\x17\n\x0f\x66ormatted_price\x18\t \x01(\t\x12\x1c\n\x14\x66ormatted_sale_price\x18\n \x01(\t\x12\x18\n\x10\x61ndroid_app_link\x18\x0b \x01(\t\x12\x14\n\x0cios_app_link\x18\x0c \x01(\t\x12\x18\n\x10ios_app_store_id\x18\r \x01(\x03\x12\x1f\n\x17similar_destination_ids\x18\x0e \x03(\t\x12\x16\n\x0e\x63ustom_mapping\x18\x0f \x01(\t\"\xbd\x01\n\x1a\x44iscoveryCarouselCardAsset\x12\x1d\n\x15marketing_image_asset\x18\x01 \x01(\t\x12$\n\x1csquare_marketing_image_asset\x18\x02 \x01(\t\x12&\n\x1eportrait_marketing_image_asset\x18\x03 \x01(\t\x12\x15\n\x08headline\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x13\x63\x61ll_to_action_text\x18\x05 \x01(\t\"\xab\x03\n\x12\x44ynamicTravelAsset\x12\x1b\n\x0e\x64\x65stination_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\torigin_id\x18\x02 \x01(\t\x12\x12\n\x05title\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x10\x64\x65stination_name\x18\x04 \x01(\t\x12\x1b\n\x13\x64\x65stination_address\x18\x05 \x01(\t\x12\x13\n\x0borigin_name\x18\x06 \x01(\t\x12\r\n\x05price\x18\x07 \x01(\t\x12\x12\n\nsale_price\x18\x08 \x01(\t\x12\x17\n\x0f\x66ormatted_price\x18\t \x01(\t\x12\x1c\n\x14\x66ormatted_sale_price\x18\n \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x0b \x01(\t\x12\x1b\n\x13\x63ontextual_keywords\x18\x0c \x03(\t\x12\x1f\n\x17similar_destination_ids\x18\r \x03(\t\x12\x11\n\timage_url\x18\x0e \x01(\t\x12\x18\n\x10\x61ndroid_app_link\x18\x0f \x01(\t\x12\x14\n\x0cios_app_link\x18\x10 \x01(\t\x12\x18\n\x10ios_app_store_id\x18\x11 \x01(\x03\"\xf9\x02\n\x11\x44ynamicLocalAsset\x12\x14\n\x07\x64\x65\x61l_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tdeal_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08subtitle\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\r\n\x05price\x18\x05 \x01(\t\x12\x12\n\nsale_price\x18\x06 \x01(\t\x12\x11\n\timage_url\x18\x07 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x08 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\t \x01(\t\x12\x1b\n\x13\x63ontextual_keywords\x18\n \x03(\t\x12\x17\n\x0f\x66ormatted_price\x18\x0b \x01(\t\x12\x1c\n\x14\x66ormatted_sale_price\x18\x0c \x01(\t\x12\x18\n\x10\x61ndroid_app_link\x18\r \x01(\t\x12\x18\n\x10similar_deal_ids\x18\x0e \x03(\t\x12\x14\n\x0cios_app_link\x18\x0f \x01(\t\x12\x18\n\x10ios_app_store_id\x18\x10 \x01(\x03\"\xc9\x02\n\x10\x44ynamicJobsAsset\x12\x13\n\x06job_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0blocation_id\x18\x02 \x01(\t\x12\x16\n\tjob_title\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0cjob_subtitle\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x11\n\timage_url\x18\x06 \x01(\t\x12\x14\n\x0cjob_category\x18\x07 \x01(\t\x12\x1b\n\x13\x63ontextual_keywords\x18\x08 \x03(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\t \x01(\t\x12\x0e\n\x06salary\x18\n \x01(\t\x12\x18\n\x10\x61ndroid_app_link\x18\x0b \x01(\t\x12\x17\n\x0fsimilar_job_ids\x18\x0c \x03(\t\x12\x14\n\x0cios_app_link\x18\r \x01(\t\x12\x18\n\x10ios_app_store_id\x18\x0e \x01(\x03\"\xf1\x01\n\rLocationAsset\x12\x10\n\x08place_id\x18\x01 \x01(\t\x12\\\n\x1a\x62usiness_profile_locations\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.common.BusinessProfileLocation\x12p\n\x17location_ownership_type\x18\x03 \x01(\x0e\x32O.google.ads.googleads.v16.enums.LocationOwnershipTypeEnum.LocationOwnershipType\"Q\n\x17\x42usinessProfileLocation\x12\x0e\n\x06labels\x18\x01 \x03(\t\x12\x12\n\nstore_code\x18\x02 \x01(\t\x12\x12\n\nlisting_id\x18\x03 \x01(\x03\"Q\n\x12HotelPropertyAsset\x12\x10\n\x08place_id\x18\x01 \x01(\t\x12\x15\n\rhotel_address\x18\x02 \x01(\t\x12\x12\n\nhotel_name\x18\x03 \x01(\tB\xef\x01\n#com.google.ads.googleads.v16.commonB\x0f\x41ssetTypesProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AdScheduleInfo", "google/ads/googleads/v16/common/criteria.proto"], + ["google.ads.googleads.v16.common.Money", "google/ads/googleads/v16/common/feed_common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + YoutubeVideoAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.YoutubeVideoAsset").msgclass + MediaBundleAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.MediaBundleAsset").msgclass + ImageAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ImageAsset").msgclass + ImageDimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ImageDimension").msgclass + TextAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TextAsset").msgclass + LeadFormAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LeadFormAsset").msgclass + LeadFormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LeadFormField").msgclass + LeadFormCustomQuestionField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LeadFormCustomQuestionField").msgclass + LeadFormSingleChoiceAnswers = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LeadFormSingleChoiceAnswers").msgclass + LeadFormDeliveryMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LeadFormDeliveryMethod").msgclass + WebhookDelivery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.WebhookDelivery").msgclass + BookOnGoogleAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BookOnGoogleAsset").msgclass + PromotionAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PromotionAsset").msgclass + CalloutAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CalloutAsset").msgclass + StructuredSnippetAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.StructuredSnippetAsset").msgclass + SitelinkAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.SitelinkAsset").msgclass + PageFeedAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PageFeedAsset").msgclass + DynamicEducationAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicEducationAsset").msgclass + MobileAppAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.MobileAppAsset").msgclass + HotelCalloutAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelCalloutAsset").msgclass + CallAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CallAsset").msgclass + PriceAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PriceAsset").msgclass + PriceOffering = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PriceOffering").msgclass + CallToActionAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CallToActionAsset").msgclass + DynamicRealEstateAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicRealEstateAsset").msgclass + DynamicCustomAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicCustomAsset").msgclass + DynamicHotelsAndRentalsAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicHotelsAndRentalsAsset").msgclass + DynamicFlightsAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicFlightsAsset").msgclass + DiscoveryCarouselCardAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DiscoveryCarouselCardAsset").msgclass + DynamicTravelAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicTravelAsset").msgclass + DynamicLocalAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicLocalAsset").msgclass + DynamicJobsAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicJobsAsset").msgclass + LocationAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LocationAsset").msgclass + BusinessProfileLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BusinessProfileLocation").msgclass + HotelPropertyAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelPropertyAsset").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/asset_usage_pb.rb b/lib/google/ads/google_ads/v16/common/asset_usage_pb.rb new file mode 100644 index 000000000..7978dbd69 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/asset_usage_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/asset_usage.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/served_asset_field_type_pb' + + +descriptor_data = "\n1google/ads/googleads/v16/common/asset_usage.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a.google.ads.googleads.v16.common.ProductChannelExclusivityInfoH\x00\x12R\n\x11product_condition\x18\n \x01(\x0b\x32\x35.google.ads.googleads.v16.common.ProductConditionInfoH\x00\x12_\n\x18product_custom_attribute\x18\x10 \x01(\x0b\x32;.google.ads.googleads.v16.common.ProductCustomAttributeInfoH\x00\x12M\n\x0fproduct_item_id\x18\x0b \x01(\x0b\x32\x32.google.ads.googleads.v16.common.ProductItemIdInfoH\x00\x12H\n\x0cproduct_type\x18\x0c \x01(\x0b\x32\x30.google.ads.googleads.v16.common.ProductTypeInfoH\x00\x12P\n\x10product_grouping\x18\x11 \x01(\x0b\x32\x34.google.ads.googleads.v16.common.ProductGroupingInfoH\x00\x12L\n\x0eproduct_labels\x18\x12 \x01(\x0b\x32\x32.google.ads.googleads.v16.common.ProductLabelsInfoH\x00\x12_\n\x18product_legacy_condition\x18\x13 \x01(\x0b\x32;.google.ads.googleads.v16.common.ProductLegacyConditionInfoH\x00\x12Q\n\x11product_type_full\x18\x14 \x01(\x0b\x32\x34.google.ads.googleads.v16.common.ProductTypeFullInfoH\x00\x12\x46\n\x0b\x61\x63tivity_id\x18\x15 \x01(\x0b\x32/.google.ads.googleads.v16.common.ActivityIdInfoH\x00\x12N\n\x0f\x61\x63tivity_rating\x18\x16 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.ActivityRatingInfoH\x00\x12P\n\x10\x61\x63tivity_country\x18\x17 \x01(\x0b\x32\x34.google.ads.googleads.v16.common.ActivityCountryInfoH\x00\x12L\n\x0e\x61\x63tivity_state\x18\x19 \x01(\x0b\x32\x32.google.ads.googleads.v16.common.ActivityStateInfoH\x00\x12J\n\ractivity_city\x18\x1a \x01(\x0b\x32\x31.google.ads.googleads.v16.common.ActivityCityInfoH\x00\x12\x61\n\x19unknown_listing_dimension\x18\x0e \x01(\x0b\x32<.google.ads.googleads.v16.common.UnknownListingDimensionInfoH\x00\x42\x0b\n\tdimension\"+\n\x0bHotelIdInfo\x12\x12\n\x05value\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\".\n\x0eHotelClassInfo\x12\x12\n\x05value\x18\x02 \x01(\x03H\x00\x88\x01\x01\x42\x08\n\x06_value\"\\\n\x16HotelCountryRegionInfo\x12%\n\x18\x63ountry_region_criterion\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x1b\n\x19_country_region_criterion\"B\n\x0eHotelStateInfo\x12\x1c\n\x0fstate_criterion\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x12\n\x10_state_criterion\"?\n\rHotelCityInfo\x12\x1b\n\x0e\x63ity_criterion\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_city_criterion\"\x9d\x01\n\x13ProductCategoryInfo\x12\x18\n\x0b\x63\x61tegory_id\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\\\n\x05level\x18\x02 \x01(\x0e\x32M.google.ads.googleads.v16.enums.ProductCategoryLevelEnum.ProductCategoryLevelB\x0e\n\x0c_category_id\"0\n\x10ProductBrandInfo\x12\x12\n\x05value\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"h\n\x12ProductChannelInfo\x12R\n\x07\x63hannel\x18\x01 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.ProductChannelEnum.ProductChannel\"\x95\x01\n\x1dProductChannelExclusivityInfo\x12t\n\x13\x63hannel_exclusivity\x18\x01 \x01(\x0e\x32W.google.ads.googleads.v16.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity\"p\n\x14ProductConditionInfo\x12X\n\tcondition\x18\x01 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.ProductConditionEnum.ProductCondition\"\xa6\x01\n\x1aProductCustomAttributeInfo\x12\x12\n\x05value\x18\x03 \x01(\tH\x00\x88\x01\x01\x12j\n\x05index\x18\x02 \x01(\x0e\x32[.google.ads.googleads.v16.enums.ProductCustomAttributeIndexEnum.ProductCustomAttributeIndexB\x08\n\x06_value\"1\n\x11ProductItemIdInfo\x12\x12\n\x05value\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"\x85\x01\n\x0fProductTypeInfo\x12\x12\n\x05value\x18\x03 \x01(\tH\x00\x88\x01\x01\x12T\n\x05level\x18\x02 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.ProductTypeLevelEnum.ProductTypeLevelB\x08\n\x06_value\"3\n\x13ProductGroupingInfo\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"1\n\x11ProductLabelsInfo\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\":\n\x1aProductLegacyConditionInfo\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"3\n\x13ProductTypeFullInfo\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"\x1d\n\x1bUnknownListingDimensionInfo\"}\n\x1aHotelDateSelectionTypeInfo\x12_\n\x04type\x18\x01 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.HotelDateSelectionTypeEnum.HotelDateSelectionType\"g\n\x1dHotelAdvanceBookingWindowInfo\x12\x15\n\x08min_days\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\x15\n\x08max_days\x18\x04 \x01(\x03H\x01\x88\x01\x01\x42\x0b\n\t_min_daysB\x0b\n\t_max_days\"g\n\x15HotelLengthOfStayInfo\x12\x17\n\nmin_nights\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\x17\n\nmax_nights\x18\x04 \x01(\x03H\x01\x88\x01\x01\x42\r\n\x0b_min_nightsB\r\n\x0b_max_nights\"A\n\x19HotelCheckInDateRangeInfo\x12\x12\n\nstart_date\x18\x01 \x01(\t\x12\x10\n\x08\x65nd_date\x18\x02 \x01(\t\"c\n\x13HotelCheckInDayInfo\x12L\n\x0b\x64\x61y_of_week\x18\x01 \x01(\x0e\x32\x37.google.ads.googleads.v16.enums.DayOfWeekEnum.DayOfWeek\".\n\x0e\x41\x63tivityIdInfo\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"2\n\x12\x41\x63tivityRatingInfo\x12\x12\n\x05value\x18\x01 \x01(\x03H\x00\x88\x01\x01\x42\x08\n\x06_value\"3\n\x13\x41\x63tivityCountryInfo\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"1\n\x11\x41\x63tivityStateInfo\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"0\n\x10\x41\x63tivityCityInfo\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"h\n\x13InteractionTypeInfo\x12Q\n\x04type\x18\x01 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.InteractionTypeEnum.InteractionType\"\xd2\x02\n\x0e\x41\x64ScheduleInfo\x12S\n\x0cstart_minute\x18\x01 \x01(\x0e\x32=.google.ads.googleads.v16.enums.MinuteOfHourEnum.MinuteOfHour\x12Q\n\nend_minute\x18\x02 \x01(\x0e\x32=.google.ads.googleads.v16.enums.MinuteOfHourEnum.MinuteOfHour\x12\x17\n\nstart_hour\x18\x06 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\x08\x65nd_hour\x18\x07 \x01(\x05H\x01\x88\x01\x01\x12L\n\x0b\x64\x61y_of_week\x18\x05 \x01(\x0e\x32\x37.google.ads.googleads.v16.enums.DayOfWeekEnum.DayOfWeekB\r\n\x0b_start_hourB\x0b\n\t_end_hour\"[\n\x0c\x41geRangeInfo\x12K\n\x04type\x18\x01 \x01(\x0e\x32=.google.ads.googleads.v16.enums.AgeRangeTypeEnum.AgeRangeType\"U\n\nGenderInfo\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.ads.googleads.v16.enums.GenderTypeEnum.GenderType\"d\n\x0fIncomeRangeInfo\x12Q\n\x04type\x18\x01 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.IncomeRangeTypeEnum.IncomeRangeType\"m\n\x12ParentalStatusInfo\x12W\n\x04type\x18\x01 \x01(\x0e\x32I.google.ads.googleads.v16.enums.ParentalStatusTypeEnum.ParentalStatusType\"6\n\x10YouTubeVideoInfo\x12\x15\n\x08video_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0b\n\t_video_id\"<\n\x12YouTubeChannelInfo\x12\x17\n\nchannel_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_channel_id\"4\n\x0cUserListInfo\x12\x16\n\tuser_list\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0c\n\n_user_list\"\x95\x02\n\rProximityInfo\x12@\n\tgeo_point\x18\x01 \x01(\x0b\x32-.google.ads.googleads.v16.common.GeoPointInfo\x12\x13\n\x06radius\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\x63\n\x0cradius_units\x18\x03 \x01(\x0e\x32M.google.ads.googleads.v16.enums.ProximityRadiusUnitsEnum.ProximityRadiusUnits\x12=\n\x07\x61\x64\x64ress\x18\x04 \x01(\x0b\x32,.google.ads.googleads.v16.common.AddressInfoB\t\n\x07_radius\"\x9c\x01\n\x0cGeoPointInfo\x12\'\n\x1alongitude_in_micro_degrees\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12&\n\x19latitude_in_micro_degrees\x18\x04 \x01(\x05H\x01\x88\x01\x01\x42\x1d\n\x1b_longitude_in_micro_degreesB\x1c\n\x1a_latitude_in_micro_degrees\"\xc7\x02\n\x0b\x41\x64\x64ressInfo\x12\x18\n\x0bpostal_code\x18\x08 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rprovince_code\x18\t \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0c\x63ountry_code\x18\n \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rprovince_name\x18\x0b \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0estreet_address\x18\x0c \x01(\tH\x04\x88\x01\x01\x12\x1c\n\x0fstreet_address2\x18\r \x01(\tH\x05\x88\x01\x01\x12\x16\n\tcity_name\x18\x0e \x01(\tH\x06\x88\x01\x01\x42\x0e\n\x0c_postal_codeB\x10\n\x0e_province_codeB\x0f\n\r_country_codeB\x10\n\x0e_province_nameB\x11\n\x0f_street_addressB\x12\n\x10_street_address2B\x0c\n\n_city_name\"v\n\tTopicInfo\x12H\n\x0etopic_constant\x18\x03 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/TopicConstantH\x00\x88\x01\x01\x12\x0c\n\x04path\x18\x04 \x03(\tB\x11\n\x0f_topic_constant\"D\n\x0cLanguageInfo\x12\x1e\n\x11language_constant\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x14\n\x12_language_constant\"5\n\x0bIpBlockInfo\x12\x17\n\nip_address\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_ip_address\"g\n\x10\x43ontentLabelInfo\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.ContentLabelTypeEnum.ContentLabelType\"p\n\x0b\x43\x61rrierInfo\x12L\n\x10\x63\x61rrier_constant\x18\x02 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/CarrierConstantH\x00\x88\x01\x01\x42\x13\n\x11_carrier_constant\"R\n\x10UserInterestInfo\x12#\n\x16user_interest_category\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x19\n\x17_user_interest_category\"\xe9\x01\n\x0bWebpageInfo\x12\x1b\n\x0e\x63riterion_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12I\n\nconditions\x18\x02 \x03(\x0b\x32\x35.google.ads.googleads.v16.common.WebpageConditionInfo\x12\x1b\n\x13\x63overage_percentage\x18\x04 \x01(\x01\x12\x42\n\x06sample\x18\x05 \x01(\x0b\x32\x32.google.ads.googleads.v16.common.WebpageSampleInfoB\x11\n\x0f_criterion_name\"\x89\x02\n\x14WebpageConditionInfo\x12\x64\n\x07operand\x18\x01 \x01(\x0e\x32S.google.ads.googleads.v16.enums.WebpageConditionOperandEnum.WebpageConditionOperand\x12g\n\x08operator\x18\x02 \x01(\x0e\x32U.google.ads.googleads.v16.enums.WebpageConditionOperatorEnum.WebpageConditionOperator\x12\x15\n\x08\x61rgument\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x0b\n\t_argument\"(\n\x11WebpageSampleInfo\x12\x13\n\x0bsample_urls\x18\x01 \x03(\t\"\xb0\x01\n\x1aOperatingSystemVersionInfo\x12l\n!operating_system_version_constant\x18\x02 \x01(\tB<\xfa\x41\x39\n7googleads.googleapis.com/OperatingSystemVersionConstantH\x00\x88\x01\x01\x42$\n\"_operating_system_version_constant\"p\n\x13\x41ppPaymentModelInfo\x12Y\n\x04type\x18\x01 \x01(\x0e\x32K.google.ads.googleads.v16.enums.AppPaymentModelTypeEnum.AppPaymentModelType\"\x86\x01\n\x10MobileDeviceInfo\x12W\n\x16mobile_device_constant\x18\x02 \x01(\tB2\xfa\x41/\n-googleads.googleapis.com/MobileDeviceConstantH\x00\x88\x01\x01\x42\x19\n\x17_mobile_device_constant\"F\n\x12\x43ustomAffinityInfo\x12\x1c\n\x0f\x63ustom_affinity\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x12\n\x10_custom_affinity\"@\n\x10\x43ustomIntentInfo\x12\x1a\n\rcustom_intent\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x10\n\x0e_custom_intent\"\xf9\x02\n\x11LocationGroupInfo\x12\x11\n\x04\x66\x65\x65\x64\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x14geo_target_constants\x18\x06 \x03(\t\x12\x13\n\x06radius\x18\x07 \x01(\x03H\x01\x88\x01\x01\x12k\n\x0cradius_units\x18\x04 \x01(\x0e\x32U.google.ads.googleads.v16.enums.LocationGroupRadiusUnitsEnum.LocationGroupRadiusUnits\x12\x16\n\x0e\x66\x65\x65\x64_item_sets\x18\x08 \x03(\t\x12\x35\n(enable_customer_level_location_asset_set\x18\t \x01(\x08H\x02\x88\x01\x01\x12!\n\x19location_group_asset_sets\x18\n \x03(\tB\x07\n\x05_feedB\t\n\x07_radiusB+\n)_enable_customer_level_location_asset_set\"-\n\x12\x43ustomAudienceInfo\x12\x17\n\x0f\x63ustom_audience\x18\x01 \x01(\t\"a\n\x14\x43ombinedAudienceInfo\x12I\n\x11\x63ombined_audience\x18\x01 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/CombinedAudience\" \n\x0c\x41udienceInfo\x12\x10\n\x08\x61udience\x18\x01 \x01(\t\"\x9c\x01\n\x10KeywordThemeInfo\x12T\n\x16keyword_theme_constant\x18\x01 \x01(\tB2\xfa\x41/\n-googleads.googleapis.com/KeywordThemeConstantH\x00\x12!\n\x17\x66ree_form_keyword_theme\x18\x02 \x01(\tH\x00\x42\x0f\n\rkeyword_theme\"(\n\x12LocalServiceIdInfo\x12\x12\n\nservice_id\x18\x01 \x01(\t\"\x1f\n\x0fSearchThemeInfo\x12\x0c\n\x04text\x18\x01 \x01(\t\"1\n\tBrandInfo\x12\x16\n\tentity_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x0c\n\n_entity_id\"7\n\rBrandListInfo\x12\x17\n\nshared_set\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_shared_setB\xed\x01\n#com.google.ads.googleads.v16.commonB\rCriteriaProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + KeywordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.KeywordInfo").msgclass + PlacementInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PlacementInfo").msgclass + NegativeKeywordListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.NegativeKeywordListInfo").msgclass + MobileAppCategoryInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.MobileAppCategoryInfo").msgclass + MobileApplicationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.MobileApplicationInfo").msgclass + LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LocationInfo").msgclass + DeviceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DeviceInfo").msgclass + ListingGroupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ListingGroupInfo").msgclass + ListingDimensionPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ListingDimensionPath").msgclass + ListingScopeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ListingScopeInfo").msgclass + ListingDimensionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ListingDimensionInfo").msgclass + HotelIdInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelIdInfo").msgclass + HotelClassInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelClassInfo").msgclass + HotelCountryRegionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelCountryRegionInfo").msgclass + HotelStateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelStateInfo").msgclass + HotelCityInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelCityInfo").msgclass + ProductCategoryInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductCategoryInfo").msgclass + ProductBrandInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductBrandInfo").msgclass + ProductChannelInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductChannelInfo").msgclass + ProductChannelExclusivityInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductChannelExclusivityInfo").msgclass + ProductConditionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductConditionInfo").msgclass + ProductCustomAttributeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductCustomAttributeInfo").msgclass + ProductItemIdInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductItemIdInfo").msgclass + ProductTypeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductTypeInfo").msgclass + ProductGroupingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductGroupingInfo").msgclass + ProductLabelsInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductLabelsInfo").msgclass + ProductLegacyConditionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductLegacyConditionInfo").msgclass + ProductTypeFullInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProductTypeFullInfo").msgclass + UnknownListingDimensionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UnknownListingDimensionInfo").msgclass + HotelDateSelectionTypeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelDateSelectionTypeInfo").msgclass + HotelAdvanceBookingWindowInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelAdvanceBookingWindowInfo").msgclass + HotelLengthOfStayInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelLengthOfStayInfo").msgclass + HotelCheckInDateRangeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelCheckInDateRangeInfo").msgclass + HotelCheckInDayInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelCheckInDayInfo").msgclass + ActivityIdInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ActivityIdInfo").msgclass + ActivityRatingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ActivityRatingInfo").msgclass + ActivityCountryInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ActivityCountryInfo").msgclass + ActivityStateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ActivityStateInfo").msgclass + ActivityCityInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ActivityCityInfo").msgclass + InteractionTypeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.InteractionTypeInfo").msgclass + AdScheduleInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.AdScheduleInfo").msgclass + AgeRangeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.AgeRangeInfo").msgclass + GenderInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.GenderInfo").msgclass + IncomeRangeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.IncomeRangeInfo").msgclass + ParentalStatusInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ParentalStatusInfo").msgclass + YouTubeVideoInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.YouTubeVideoInfo").msgclass + YouTubeChannelInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.YouTubeChannelInfo").msgclass + UserListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListInfo").msgclass + ProximityInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ProximityInfo").msgclass + GeoPointInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.GeoPointInfo").msgclass + AddressInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.AddressInfo").msgclass + TopicInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TopicInfo").msgclass + LanguageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LanguageInfo").msgclass + IpBlockInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.IpBlockInfo").msgclass + ContentLabelInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ContentLabelInfo").msgclass + CarrierInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CarrierInfo").msgclass + UserInterestInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserInterestInfo").msgclass + WebpageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.WebpageInfo").msgclass + WebpageConditionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.WebpageConditionInfo").msgclass + WebpageSampleInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.WebpageSampleInfo").msgclass + OperatingSystemVersionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.OperatingSystemVersionInfo").msgclass + AppPaymentModelInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.AppPaymentModelInfo").msgclass + MobileDeviceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.MobileDeviceInfo").msgclass + CustomAffinityInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CustomAffinityInfo").msgclass + CustomIntentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CustomIntentInfo").msgclass + LocationGroupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LocationGroupInfo").msgclass + CustomAudienceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CustomAudienceInfo").msgclass + CombinedAudienceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CombinedAudienceInfo").msgclass + AudienceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.AudienceInfo").msgclass + KeywordThemeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.KeywordThemeInfo").msgclass + LocalServiceIdInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LocalServiceIdInfo").msgclass + SearchThemeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.SearchThemeInfo").msgclass + BrandInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BrandInfo").msgclass + BrandListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BrandListInfo").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/criterion_category_availability_pb.rb b/lib/google/ads/google_ads/v16/common/criterion_category_availability_pb.rb new file mode 100644 index 000000000..c2beb4ea2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/criterion_category_availability_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/criterion_category_availability.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/advertising_channel_sub_type_pb' +require 'google/ads/google_ads/v16/enums/advertising_channel_type_pb' +require 'google/ads/google_ads/v16/enums/criterion_category_channel_availability_mode_pb' +require 'google/ads/google_ads/v16/enums/criterion_category_locale_availability_mode_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/common/criterion_category_availability.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x41google/ads/googleads/v16/enums/advertising_channel_sub_type.proto\x1a=google/ads/googleads/v16/enums/advertising_channel_type.proto\x1aQgoogle/ads/googleads/v16/enums/criterion_category_channel_availability_mode.proto\x1aPgoogle/ads/googleads/v16/enums/criterion_category_locale_availability_mode.proto\"\xcd\x01\n\x1d\x43riterionCategoryAvailability\x12V\n\x07\x63hannel\x18\x01 \x01(\x0b\x32\x45.google.ads.googleads.v16.common.CriterionCategoryChannelAvailability\x12T\n\x06locale\x18\x02 \x03(\x0b\x32\x44.google.ads.googleads.v16.common.CriterionCategoryLocaleAvailability\"\x81\x04\n$CriterionCategoryChannelAvailability\x12\x90\x01\n\x11\x61vailability_mode\x18\x01 \x01(\x0e\x32u.google.ads.googleads.v16.enums.CriterionCategoryChannelAvailabilityModeEnum.CriterionCategoryChannelAvailabilityMode\x12s\n\x18\x61\x64vertising_channel_type\x18\x02 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.AdvertisingChannelTypeEnum.AdvertisingChannelType\x12}\n\x1c\x61\x64vertising_channel_sub_type\x18\x03 \x03(\x0e\x32W.google.ads.googleads.v16.enums.AdvertisingChannelSubTypeEnum.AdvertisingChannelSubType\x12-\n include_default_channel_sub_type\x18\x05 \x01(\x08H\x00\x88\x01\x01\x42#\n!_include_default_channel_sub_type\"\x90\x02\n#CriterionCategoryLocaleAvailability\x12\x8e\x01\n\x11\x61vailability_mode\x18\x01 \x01(\x0e\x32s.google.ads.googleads.v16.enums.CriterionCategoryLocaleAvailabilityModeEnum.CriterionCategoryLocaleAvailabilityMode\x12\x19\n\x0c\x63ountry_code\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tH\x01\x88\x01\x01\x42\x0f\n\r_country_codeB\x10\n\x0e_language_codeB\x82\x02\n#com.google.ads.googleads.v16.commonB\"CriterionCategoryAvailabilityProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + CriterionCategoryAvailability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CriterionCategoryAvailability").msgclass + CriterionCategoryChannelAvailability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CriterionCategoryChannelAvailability").msgclass + CriterionCategoryLocaleAvailability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CriterionCategoryLocaleAvailability").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/custom_parameter_pb.rb b/lib/google/ads/google_ads/v16/common/custom_parameter_pb.rb new file mode 100644 index 000000000..bbecb8a92 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/custom_parameter_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/custom_parameter.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/ads/googleads/v16/common/custom_parameter.proto\x12\x1fgoogle.ads.googleads.v16.common\"I\n\x0f\x43ustomParameter\x12\x10\n\x03key\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05value\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x06\n\x04_keyB\x08\n\x06_valueB\xf4\x01\n#com.google.ads.googleads.v16.commonB\x14\x43ustomParameterProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + CustomParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CustomParameter").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/customizer_value_pb.rb b/lib/google/ads/google_ads/v16/common/customizer_value_pb.rb new file mode 100644 index 000000000..dab930aa9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/customizer_value_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/customizer_value.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/customizer_attribute_type_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n6google/ads/googleads/v16/common/customizer_value.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a>google/ads/googleads/v16/enums/customizer_attribute_type.proto\x1a\x1fgoogle/api/field_behavior.proto\"\x94\x01\n\x0f\x43ustomizerValue\x12\x66\n\x04type\x18\x01 \x01(\x0e\x32S.google.ads.googleads.v16.enums.CustomizerAttributeTypeEnum.CustomizerAttributeTypeB\x03\xe0\x41\x02\x12\x19\n\x0cstring_value\x18\x02 \x01(\tB\x03\xe0\x41\x02\x42\xf4\x01\n#com.google.ads.googleads.v16.commonB\x14\x43ustomizerValueProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + CustomizerValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CustomizerValue").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/dates_pb.rb b/lib/google/ads/google_ads/v16/common/dates_pb.rb new file mode 100644 index 000000000..e87ffa7f7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/dates_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/dates.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/month_of_year_pb' + + +descriptor_data = "\n+google/ads/googleads/v16/common/dates.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x32google/ads/googleads/v16/enums/month_of_year.proto\"W\n\tDateRange\x12\x17\n\nstart_date\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08\x65nd_date\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\r\n\x0b_start_dateB\x0b\n\t_end_date\"\x84\x01\n\x0eYearMonthRange\x12\x39\n\x05start\x18\x01 \x01(\x0b\x32*.google.ads.googleads.v16.common.YearMonth\x12\x37\n\x03\x65nd\x18\x02 \x01(\x0b\x32*.google.ads.googleads.v16.common.YearMonth\"e\n\tYearMonth\x12\x0c\n\x04year\x18\x01 \x01(\x03\x12J\n\x05month\x18\x02 \x01(\x0e\x32;.google.ads.googleads.v16.enums.MonthOfYearEnum.MonthOfYearB\xea\x01\n#com.google.ads.googleads.v16.commonB\nDatesProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + DateRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DateRange").msgclass + YearMonthRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.YearMonthRange").msgclass + YearMonth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.YearMonth").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/extensions_pb.rb b/lib/google/ads/google_ads/v16/common/extensions_pb.rb new file mode 100644 index 000000000..17c6f8582 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/extensions_pb.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/extensions.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/custom_parameter_pb' +require 'google/ads/google_ads/v16/common/feed_common_pb' +require 'google/ads/google_ads/v16/enums/app_store_pb' +require 'google/ads/google_ads/v16/enums/call_conversion_reporting_state_pb' +require 'google/ads/google_ads/v16/enums/price_extension_price_qualifier_pb' +require 'google/ads/google_ads/v16/enums/price_extension_price_unit_pb' +require 'google/ads/google_ads/v16/enums/price_extension_type_pb' +require 'google/ads/google_ads/v16/enums/promotion_extension_discount_modifier_pb' +require 'google/ads/google_ads/v16/enums/promotion_extension_occasion_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n0google/ads/googleads/v16/common/extensions.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x36google/ads/googleads/v16/common/custom_parameter.proto\x1a\x31google/ads/googleads/v16/common/feed_common.proto\x1a.google/ads/googleads/v16/enums/app_store.proto\x1a\x44google/ads/googleads/v16/enums/call_conversion_reporting_state.proto\x1a\x44google/ads/googleads/v16/enums/price_extension_price_qualifier.proto\x1a?google/ads/googleads/v16/enums/price_extension_price_unit.proto\x1a\x39google/ads/googleads/v16/enums/price_extension_type.proto\x1aJgoogle/ads/googleads/v16/enums/promotion_extension_discount_modifier.proto\x1a\x41google/ads/googleads/v16/enums/promotion_extension_occasion.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x8f\x03\n\x0b\x41ppFeedItem\x12\x16\n\tlink_text\x18\t \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x61pp_id\x18\n \x01(\tH\x01\x88\x01\x01\x12H\n\tapp_store\x18\x03 \x01(\x0e\x32\x35.google.ads.googleads.v16.enums.AppStoreEnum.AppStore\x12\x12\n\nfinal_urls\x18\x0b \x03(\t\x12\x19\n\x11\x66inal_mobile_urls\x18\x0c \x03(\t\x12\"\n\x15tracking_url_template\x18\r \x01(\tH\x02\x88\x01\x01\x12O\n\x15url_custom_parameters\x18\x07 \x03(\x0b\x32\x30.google.ads.googleads.v16.common.CustomParameter\x12\x1d\n\x10\x66inal_url_suffix\x18\x0e \x01(\tH\x03\x88\x01\x01\x42\x0c\n\n_link_textB\t\n\x07_app_idB\x18\n\x16_tracking_url_templateB\x13\n\x11_final_url_suffix\"\xc3\x03\n\x0c\x43\x61llFeedItem\x12\x19\n\x0cphone_number\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x63ountry_code\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\"\n\x15\x63\x61ll_tracking_enabled\x18\t \x01(\x08H\x02\x88\x01\x01\x12#\n\x16\x63\x61ll_conversion_action\x18\n \x01(\tH\x03\x88\x01\x01\x12.\n!call_conversion_tracking_disabled\x18\x0b \x01(\x08H\x04\x88\x01\x01\x12\x86\x01\n\x1f\x63\x61ll_conversion_reporting_state\x18\x06 \x01(\x0e\x32].google.ads.googleads.v16.enums.CallConversionReportingStateEnum.CallConversionReportingStateB\x0f\n\r_phone_numberB\x0f\n\r_country_codeB\x18\n\x16_call_tracking_enabledB\x19\n\x17_call_conversion_actionB$\n\"_call_conversion_tracking_disabled\"=\n\x0f\x43\x61lloutFeedItem\x12\x19\n\x0c\x63\x61llout_text\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_callout_text\"\xe2\x02\n\x10LocationFeedItem\x12\x1a\n\rbusiness_name\x18\t \x01(\tH\x00\x88\x01\x01\x12\x1b\n\x0e\x61\x64\x64ress_line_1\x18\n \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0e\x61\x64\x64ress_line_2\x18\x0b \x01(\tH\x02\x88\x01\x01\x12\x11\n\x04\x63ity\x18\x0c \x01(\tH\x03\x88\x01\x01\x12\x15\n\x08province\x18\r \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bpostal_code\x18\x0e \x01(\tH\x05\x88\x01\x01\x12\x19\n\x0c\x63ountry_code\x18\x0f \x01(\tH\x06\x88\x01\x01\x12\x19\n\x0cphone_number\x18\x10 \x01(\tH\x07\x88\x01\x01\x42\x10\n\x0e_business_nameB\x11\n\x0f_address_line_1B\x11\n\x0f_address_line_2B\x07\n\x05_cityB\x0b\n\t_provinceB\x0e\n\x0c_postal_codeB\x0f\n\r_country_codeB\x0f\n\r_phone_number\"\xb7\x03\n\x19\x41\x66\x66iliateLocationFeedItem\x12\x1a\n\rbusiness_name\x18\x0b \x01(\tH\x00\x88\x01\x01\x12\x1b\n\x0e\x61\x64\x64ress_line_1\x18\x0c \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0e\x61\x64\x64ress_line_2\x18\r \x01(\tH\x02\x88\x01\x01\x12\x11\n\x04\x63ity\x18\x0e \x01(\tH\x03\x88\x01\x01\x12\x15\n\x08province\x18\x0f \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bpostal_code\x18\x10 \x01(\tH\x05\x88\x01\x01\x12\x19\n\x0c\x63ountry_code\x18\x11 \x01(\tH\x06\x88\x01\x01\x12\x19\n\x0cphone_number\x18\x12 \x01(\tH\x07\x88\x01\x01\x12\x15\n\x08\x63hain_id\x18\x13 \x01(\x03H\x08\x88\x01\x01\x12\x17\n\nchain_name\x18\x14 \x01(\tH\t\x88\x01\x01\x42\x10\n\x0e_business_nameB\x11\n\x0f_address_line_1B\x11\n\x0f_address_line_2B\x07\n\x05_cityB\x0b\n\t_provinceB\x0e\n\x0c_postal_codeB\x0f\n\r_country_codeB\x0f\n\r_phone_numberB\x0b\n\t_chain_idB\r\n\x0b_chain_name\"\xe7\x01\n\x13TextMessageFeedItem\x12\x1a\n\rbusiness_name\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x63ountry_code\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cphone_number\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x11\n\x04text\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0e\x65xtension_text\x18\n \x01(\tH\x04\x88\x01\x01\x42\x10\n\x0e_business_nameB\x0f\n\r_country_codeB\x0f\n\r_phone_numberB\x07\n\x05_textB\x11\n\x0f_extension_text\"\xc6\x03\n\rPriceFeedItem\x12W\n\x04type\x18\x01 \x01(\x0e\x32I.google.ads.googleads.v16.enums.PriceExtensionTypeEnum.PriceExtensionType\x12v\n\x0fprice_qualifier\x18\x02 \x01(\x0e\x32].google.ads.googleads.v16.enums.PriceExtensionPriceQualifierEnum.PriceExtensionPriceQualifier\x12\"\n\x15tracking_url_template\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rlanguage_code\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x44\n\x0fprice_offerings\x18\x05 \x03(\x0b\x32+.google.ads.googleads.v16.common.PriceOffer\x12\x1d\n\x10\x66inal_url_suffix\x18\t \x01(\tH\x02\x88\x01\x01\x42\x18\n\x16_tracking_url_templateB\x10\n\x0e_language_codeB\x13\n\x11_final_url_suffix\"\x9f\x02\n\nPriceOffer\x12\x13\n\x06header\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x35\n\x05price\x18\x03 \x01(\x0b\x32&.google.ads.googleads.v16.common.Money\x12\x61\n\x04unit\x18\x04 \x01(\x0e\x32S.google.ads.googleads.v16.enums.PriceExtensionPriceUnitEnum.PriceExtensionPriceUnit\x12\x12\n\nfinal_urls\x18\t \x03(\t\x12\x19\n\x11\x66inal_mobile_urls\x18\n \x03(\tB\t\n\x07_headerB\x0e\n\x0c_description\"\xb0\x07\n\x11PromotionFeedItem\x12\x1d\n\x10promotion_target\x18\x10 \x01(\tH\x02\x88\x01\x01\x12\x84\x01\n\x11\x64iscount_modifier\x18\x02 \x01(\x0e\x32i.google.ads.googleads.v16.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier\x12!\n\x14promotion_start_date\x18\x13 \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12promotion_end_date\x18\x14 \x01(\tH\x04\x88\x01\x01\x12k\n\x08occasion\x18\t \x01(\x0e\x32Y.google.ads.googleads.v16.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion\x12\x12\n\nfinal_urls\x18\x15 \x03(\t\x12\x19\n\x11\x66inal_mobile_urls\x18\x16 \x03(\t\x12\"\n\x15tracking_url_template\x18\x17 \x01(\tH\x05\x88\x01\x01\x12O\n\x15url_custom_parameters\x18\r \x03(\x0b\x32\x30.google.ads.googleads.v16.common.CustomParameter\x12\x1d\n\x10\x66inal_url_suffix\x18\x18 \x01(\tH\x06\x88\x01\x01\x12\x1a\n\rlanguage_code\x18\x19 \x01(\tH\x07\x88\x01\x01\x12\x15\n\x0bpercent_off\x18\x11 \x01(\x03H\x00\x12\x42\n\x10money_amount_off\x18\x04 \x01(\x0b\x32&.google.ads.googleads.v16.common.MoneyH\x00\x12\x18\n\x0epromotion_code\x18\x12 \x01(\tH\x01\x12\x44\n\x12orders_over_amount\x18\x06 \x01(\x0b\x32&.google.ads.googleads.v16.common.MoneyH\x01\x42\x0f\n\rdiscount_typeB\x13\n\x11promotion_triggerB\x13\n\x11_promotion_targetB\x17\n\x15_promotion_start_dateB\x15\n\x13_promotion_end_dateB\x18\n\x16_tracking_url_templateB\x13\n\x11_final_url_suffixB\x10\n\x0e_language_code\"K\n\x19StructuredSnippetFeedItem\x12\x13\n\x06header\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x0e\n\x06values\x18\x04 \x03(\tB\t\n\x07_header\"\xe6\x02\n\x10SitelinkFeedItem\x12\x16\n\tlink_text\x18\t \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05line1\x18\n \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05line2\x18\x0b \x01(\tH\x02\x88\x01\x01\x12\x12\n\nfinal_urls\x18\x0c \x03(\t\x12\x19\n\x11\x66inal_mobile_urls\x18\r \x03(\t\x12\"\n\x15tracking_url_template\x18\x0e \x01(\tH\x03\x88\x01\x01\x12O\n\x15url_custom_parameters\x18\x07 \x03(\x0b\x32\x30.google.ads.googleads.v16.common.CustomParameter\x12\x1d\n\x10\x66inal_url_suffix\x18\x0f \x01(\tH\x04\x88\x01\x01\x42\x0c\n\n_link_textB\x08\n\x06_line1B\x08\n\x06_line2B\x18\n\x16_tracking_url_templateB\x13\n\x11_final_url_suffix\"`\n\x14HotelCalloutFeedItem\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_textB\x10\n\x0e_language_code\"L\n\rImageFeedItem\x12;\n\x0bimage_asset\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1egoogleads.googleapis.com/AssetB\xef\x01\n#com.google.ads.googleads.v16.commonB\x0f\x45xtensionsProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CustomParameter", "google/ads/googleads/v16/common/custom_parameter.proto"], + ["google.ads.googleads.v16.common.Money", "google/ads/googleads/v16/common/feed_common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + AppFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.AppFeedItem").msgclass + CallFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CallFeedItem").msgclass + CalloutFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CalloutFeedItem").msgclass + LocationFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LocationFeedItem").msgclass + AffiliateLocationFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.AffiliateLocationFeedItem").msgclass + TextMessageFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TextMessageFeedItem").msgclass + PriceFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PriceFeedItem").msgclass + PriceOffer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PriceOffer").msgclass + PromotionFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PromotionFeedItem").msgclass + StructuredSnippetFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.StructuredSnippetFeedItem").msgclass + SitelinkFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.SitelinkFeedItem").msgclass + HotelCalloutFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.HotelCalloutFeedItem").msgclass + ImageFeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ImageFeedItem").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/feed_common_pb.rb b/lib/google/ads/google_ads/v16/common/feed_common_pb.rb new file mode 100644 index 000000000..b5c9f0af8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/feed_common_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/feed_common.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/ads/googleads/v16/common/feed_common.proto\x12\x1fgoogle.ads.googleads.v16.common\"c\n\x05Money\x12\x1a\n\rcurrency_code\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\ramount_micros\x18\x04 \x01(\x03H\x01\x88\x01\x01\x42\x10\n\x0e_currency_codeB\x10\n\x0e_amount_microsB\xef\x01\n#com.google.ads.googleads.v16.commonB\x0f\x46\x65\x65\x64\x43ommonProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + Money = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Money").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/feed_item_set_filter_type_infos_pb.rb b/lib/google/ads/google_ads/v16/common/feed_item_set_filter_type_infos_pb.rb new file mode 100644 index 000000000..b1bafe884 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/feed_item_set_filter_type_infos_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/feed_item_set_filter_type_infos.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/feed_item_set_string_filter_type_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/common/feed_item_set_filter_type_infos.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x45google/ads/googleads/v16/enums/feed_item_set_string_filter_type.proto\"}\n\x18\x44ynamicLocationSetFilter\x12\x0e\n\x06labels\x18\x01 \x03(\t\x12Q\n\x14\x62usiness_name_filter\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.BusinessNameFilter\"\x9d\x01\n\x12\x42usinessNameFilter\x12\x15\n\rbusiness_name\x18\x01 \x01(\t\x12p\n\x0b\x66ilter_type\x18\x02 \x01(\x0e\x32[.google.ads.googleads.v16.enums.FeedItemSetStringFilterTypeEnum.FeedItemSetStringFilterType\"6\n!DynamicAffiliateLocationSetFilter\x12\x11\n\tchain_ids\x18\x01 \x03(\x03\x42\xff\x01\n#com.google.ads.googleads.v16.commonB\x1f\x46\x65\x65\x64ItemSetFilterTypeInfosProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + DynamicLocationSetFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicLocationSetFilter").msgclass + BusinessNameFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BusinessNameFilter").msgclass + DynamicAffiliateLocationSetFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.DynamicAffiliateLocationSetFilter").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/final_app_url_pb.rb b/lib/google/ads/google_ads/v16/common/final_app_url_pb.rb new file mode 100644 index 000000000..de7c0ba0b --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/final_app_url_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/final_app_url.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/app_url_operating_system_type_pb' + + +descriptor_data = "\n3google/ads/googleads/v16/common/final_app_url.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x42google/ads/googleads/v16/enums/app_url_operating_system_type.proto\"\x91\x01\n\x0b\x46inalAppUrl\x12h\n\x07os_type\x18\x01 \x01(\x0e\x32W.google.ads.googleads.v16.enums.AppUrlOperatingSystemTypeEnum.AppUrlOperatingSystemType\x12\x10\n\x03url\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x06\n\x04_urlB\xf0\x01\n#com.google.ads.googleads.v16.commonB\x10\x46inalAppUrlProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + FinalAppUrl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.FinalAppUrl").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/frequency_cap_pb.rb b/lib/google/ads/google_ads/v16/common/frequency_cap_pb.rb new file mode 100644 index 000000000..06d340eb0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/frequency_cap_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/frequency_cap.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/frequency_cap_event_type_pb' +require 'google/ads/google_ads/v16/enums/frequency_cap_level_pb' +require 'google/ads/google_ads/v16/enums/frequency_cap_time_unit_pb' + + +descriptor_data = "\n3google/ads/googleads/v16/common/frequency_cap.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a=google/ads/googleads/v16/enums/frequency_cap_event_type.proto\x1a\x38google/ads/googleads/v16/enums/frequency_cap_level.proto\x1a.google.ads.googleads.v16.common.Operand.RequestContextOperandH\x00\x1a\x8a\x01\n\x0f\x43onstantOperand\x12\x16\n\x0cstring_value\x18\x05 \x01(\tH\x00\x12\x14\n\nlong_value\x18\x06 \x01(\x03H\x00\x12\x17\n\rboolean_value\x18\x07 \x01(\x08H\x00\x12\x16\n\x0c\x64ouble_value\x18\x08 \x01(\x01H\x00\x42\x18\n\x16\x63onstant_operand_value\x1an\n\x14\x46\x65\x65\x64\x41ttributeOperand\x12\x14\n\x07\x66\x65\x65\x64_id\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\x1e\n\x11\x66\x65\x65\x64_attribute_id\x18\x04 \x01(\x03H\x01\x88\x01\x01\x42\n\n\x08_feed_idB\x14\n\x12_feed_attribute_id\x1a_\n\x0f\x46unctionOperand\x12L\n\x11matching_function\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.MatchingFunction\x1a\x8a\x01\n\x15RequestContextOperand\x12q\n\x0c\x63ontext_type\x18\x01 \x01(\x0e\x32[.google.ads.googleads.v16.enums.MatchingFunctionContextTypeEnum.MatchingFunctionContextTypeB\x1b\n\x19\x66unction_argument_operandB\xf5\x01\n#com.google.ads.googleads.v16.commonB\x15MatchingFunctionProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + MatchingFunction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.MatchingFunction").msgclass + Operand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Operand").msgclass + Operand::ConstantOperand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Operand.ConstantOperand").msgclass + Operand::FeedAttributeOperand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Operand.FeedAttributeOperand").msgclass + Operand::FunctionOperand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Operand.FunctionOperand").msgclass + Operand::RequestContextOperand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Operand.RequestContextOperand").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/metric_goal_pb.rb b/lib/google/ads/google_ads/v16/common/metric_goal_pb.rb new file mode 100644 index 000000000..fb52e4288 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/metric_goal_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/metric_goal.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/experiment_metric_pb' +require 'google/ads/google_ads/v16/enums/experiment_metric_direction_pb' + + +descriptor_data = "\n1google/ads/googleads/v16/common/metric_goal.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x36google/ads/googleads/v16/enums/experiment_metric.proto\x1a@google/ads/googleads/v16/enums/experiment_metric_direction.proto\"\xcf\x01\n\nMetricGoal\x12U\n\x06metric\x18\x01 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.ExperimentMetricEnum.ExperimentMetric\x12j\n\tdirection\x18\x02 \x01(\x0e\x32W.google.ads.googleads.v16.enums.ExperimentMetricDirectionEnum.ExperimentMetricDirectionB\xef\x01\n#com.google.ads.googleads.v16.commonB\x0fMetricGoalProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + MetricGoal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.MetricGoal").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/metrics_pb.rb b/lib/google/ads/google_ads/v16/common/metrics_pb.rb new file mode 100644 index 000000000..4d41d1445 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/metrics_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/metrics.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/interaction_event_type_pb' +require 'google/ads/google_ads/v16/enums/quality_score_bucket_pb' + + +descriptor_data = "\n-google/ads/googleads/v16/common/metrics.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a;google/ads/googleads/v16/enums/interaction_event_type.proto\x1a\x39google/ads/googleads/v16/enums/quality_score_bucket.proto\"\xb9h\n\x07Metrics\x12\x30\n\"absolute_top_impression_percentage\x18\xb7\x01 \x01(\x01H\x00\x88\x01\x01\x12\x1d\n\x0f\x61\x63tive_view_cpm\x18\xb8\x01 \x01(\x01H\x01\x88\x01\x01\x12\x1d\n\x0f\x61\x63tive_view_ctr\x18\xb9\x01 \x01(\x01H\x02\x88\x01\x01\x12%\n\x17\x61\x63tive_view_impressions\x18\xba\x01 \x01(\x03H\x03\x88\x01\x01\x12\'\n\x19\x61\x63tive_view_measurability\x18\xbb\x01 \x01(\x01H\x04\x88\x01\x01\x12\x30\n\"active_view_measurable_cost_micros\x18\xbc\x01 \x01(\x03H\x05\x88\x01\x01\x12\x30\n\"active_view_measurable_impressions\x18\xbd\x01 \x01(\x03H\x06\x88\x01\x01\x12%\n\x17\x61\x63tive_view_viewability\x18\xbe\x01 \x01(\x01H\x07\x88\x01\x01\x12\x34\n&all_conversions_from_interactions_rate\x18\xbf\x01 \x01(\x01H\x08\x88\x01\x01\x12#\n\x15\x61ll_conversions_value\x18\xc0\x01 \x01(\x01H\t\x88\x01\x01\x12\x31\n(all_conversions_value_by_conversion_date\x18\xf0\x01 \x01(\x01\x12-\n\x1f\x61ll_new_customer_lifetime_value\x18\xa6\x02 \x01(\x01H\n\x88\x01\x01\x12\x1d\n\x0f\x61ll_conversions\x18\xc1\x01 \x01(\x01H\x0b\x88\x01\x01\x12+\n\"all_conversions_by_conversion_date\x18\xf1\x01 \x01(\x01\x12,\n\x1e\x61ll_conversions_value_per_cost\x18\xc2\x01 \x01(\x01H\x0c\x88\x01\x01\x12\x30\n\"all_conversions_from_click_to_call\x18\xc3\x01 \x01(\x01H\r\x88\x01\x01\x12-\n\x1f\x61ll_conversions_from_directions\x18\xc4\x01 \x01(\x01H\x0e\x88\x01\x01\x12\x45\n7all_conversions_from_interactions_value_per_interaction\x18\xc5\x01 \x01(\x01H\x0f\x88\x01\x01\x12\'\n\x19\x61ll_conversions_from_menu\x18\xc6\x01 \x01(\x01H\x10\x88\x01\x01\x12(\n\x1a\x61ll_conversions_from_order\x18\xc7\x01 \x01(\x01H\x11\x88\x01\x01\x12\x33\n%all_conversions_from_other_engagement\x18\xc8\x01 \x01(\x01H\x12\x88\x01\x01\x12.\n all_conversions_from_store_visit\x18\xc9\x01 \x01(\x01H\x13\x88\x01\x01\x12\x30\n\"all_conversions_from_store_website\x18\xca\x01 \x01(\x01H\x14\x88\x01\x01\x12G\n9auction_insight_search_absolute_top_impression_percentage\x18\x82\x02 \x01(\x01H\x15\x88\x01\x01\x12\x35\n\'auction_insight_search_impression_share\x18\x83\x02 \x01(\x01H\x16\x88\x01\x01\x12\x35\n\'auction_insight_search_outranking_share\x18\x84\x02 \x01(\x01H\x17\x88\x01\x01\x12\x31\n#auction_insight_search_overlap_rate\x18\x85\x02 \x01(\x01H\x18\x88\x01\x01\x12\x38\n*auction_insight_search_position_above_rate\x18\x86\x02 \x01(\x01H\x19\x88\x01\x01\x12>\n0auction_insight_search_top_impression_percentage\x18\x87\x02 \x01(\x01H\x1a\x88\x01\x01\x12\x1a\n\x0c\x61verage_cost\x18\xcb\x01 \x01(\x01H\x1b\x88\x01\x01\x12\x19\n\x0b\x61verage_cpc\x18\xcc\x01 \x01(\x01H\x1c\x88\x01\x01\x12\x19\n\x0b\x61verage_cpe\x18\xcd\x01 \x01(\x01H\x1d\x88\x01\x01\x12\x19\n\x0b\x61verage_cpm\x18\xce\x01 \x01(\x01H\x1e\x88\x01\x01\x12\x19\n\x0b\x61verage_cpv\x18\xcf\x01 \x01(\x01H\x1f\x88\x01\x01\x12 \n\x12\x61verage_page_views\x18\xd0\x01 \x01(\x01H \x88\x01\x01\x12\"\n\x14\x61verage_time_on_site\x18\xd1\x01 \x01(\x01H!\x88\x01\x01\x12\'\n\x19\x62\x65nchmark_average_max_cpc\x18\xd2\x01 \x01(\x01H\"\x88\x01\x01\x12.\n biddable_app_install_conversions\x18\xfe\x01 \x01(\x01H#\x88\x01\x01\x12\x33\n%biddable_app_post_install_conversions\x18\xff\x01 \x01(\x01H$\x88\x01\x01\x12\x1b\n\rbenchmark_ctr\x18\xd3\x01 \x01(\x01H%\x88\x01\x01\x12\x19\n\x0b\x62ounce_rate\x18\xd4\x01 \x01(\x01H&\x88\x01\x01\x12\x14\n\x06\x63licks\x18\x83\x01 \x01(\x03H\'\x88\x01\x01\x12\x1d\n\x0f\x63ombined_clicks\x18\x9c\x01 \x01(\x03H(\x88\x01\x01\x12\'\n\x19\x63ombined_clicks_per_query\x18\x9d\x01 \x01(\x01H)\x88\x01\x01\x12\x1e\n\x10\x63ombined_queries\x18\x9e\x01 \x01(\x03H*\x88\x01\x01\x12\x32\n$content_budget_lost_impression_share\x18\x9f\x01 \x01(\x01H+\x88\x01\x01\x12&\n\x18\x63ontent_impression_share\x18\xa0\x01 \x01(\x01H,\x88\x01\x01\x12\x38\n*conversion_last_received_request_date_time\x18\xa1\x01 \x01(\tH-\x88\x01\x01\x12-\n\x1f\x63onversion_last_conversion_date\x18\xa2\x01 \x01(\tH.\x88\x01\x01\x12\x30\n\"content_rank_lost_impression_share\x18\xa3\x01 \x01(\x01H/\x88\x01\x01\x12\x30\n\"conversions_from_interactions_rate\x18\xa4\x01 \x01(\x01H0\x88\x01\x01\x12\x1f\n\x11\x63onversions_value\x18\xa5\x01 \x01(\x01H1\x88\x01\x01\x12-\n$conversions_value_by_conversion_date\x18\xf2\x01 \x01(\x01\x12)\n\x1bnew_customer_lifetime_value\x18\xa5\x02 \x01(\x01H2\x88\x01\x01\x12(\n\x1a\x63onversions_value_per_cost\x18\xa6\x01 \x01(\x01H3\x88\x01\x01\x12\x41\n3conversions_from_interactions_value_per_interaction\x18\xa7\x01 \x01(\x01H4\x88\x01\x01\x12\x19\n\x0b\x63onversions\x18\xa8\x01 \x01(\x01H5\x88\x01\x01\x12\'\n\x1e\x63onversions_by_conversion_date\x18\xf3\x01 \x01(\x01\x12\x19\n\x0b\x63ost_micros\x18\xa9\x01 \x01(\x03H6\x88\x01\x01\x12&\n\x18\x63ost_per_all_conversions\x18\xaa\x01 \x01(\x01H7\x88\x01\x01\x12!\n\x13\x63ost_per_conversion\x18\xab\x01 \x01(\x01H8\x88\x01\x01\x12:\n,cost_per_current_model_attributed_conversion\x18\xac\x01 \x01(\x01H9\x88\x01\x01\x12&\n\x18\x63ross_device_conversions\x18\xad\x01 \x01(\x01H:\x88\x01\x01\x12\x33\n%cross_device_conversions_value_micros\x18\xb8\x02 \x01(\x03H;\x88\x01\x01\x12\x11\n\x03\x63tr\x18\xae\x01 \x01(\x01H<\x88\x01\x01\x12\x32\n$current_model_attributed_conversions\x18\xaf\x01 \x01(\x01H=\x88\x01\x01\x12I\n;current_model_attributed_conversions_from_interactions_rate\x18\xb0\x01 \x01(\x01H>\x88\x01\x01\x12Z\nLcurrent_model_attributed_conversions_from_interactions_value_per_interaction\x18\xb1\x01 \x01(\x01H?\x88\x01\x01\x12\x38\n*current_model_attributed_conversions_value\x18\xb2\x01 \x01(\x01H@\x88\x01\x01\x12\x41\n3current_model_attributed_conversions_value_per_cost\x18\xb3\x01 \x01(\x01HA\x88\x01\x01\x12\x1d\n\x0f\x65ngagement_rate\x18\xb4\x01 \x01(\x01HB\x88\x01\x01\x12\x19\n\x0b\x65ngagements\x18\xb5\x01 \x01(\x03HC\x88\x01\x01\x12-\n\x1fhotel_average_lead_value_micros\x18\xd5\x01 \x01(\x01HD\x88\x01\x01\x12*\n\x1chotel_commission_rate_micros\x18\x80\x02 \x01(\x03HE\x88\x01\x01\x12,\n\x1ehotel_expected_commission_cost\x18\x81\x02 \x01(\x01HF\x88\x01\x01\x12/\n!hotel_price_difference_percentage\x18\xd6\x01 \x01(\x01HG\x88\x01\x01\x12(\n\x1ahotel_eligible_impressions\x18\xd7\x01 \x01(\x03HH\x88\x01\x01\x12t\n!historical_creative_quality_score\x18P \x01(\x0e\x32I.google.ads.googleads.v16.enums.QualityScoreBucketEnum.QualityScoreBucket\x12x\n%historical_landing_page_quality_score\x18Q \x01(\x0e\x32I.google.ads.googleads.v16.enums.QualityScoreBucketEnum.QualityScoreBucket\x12&\n\x18historical_quality_score\x18\xd8\x01 \x01(\x03HI\x88\x01\x01\x12r\n\x1fhistorical_search_predicted_ctr\x18S \x01(\x0e\x32I.google.ads.googleads.v16.enums.QualityScoreBucketEnum.QualityScoreBucket\x12\x1c\n\x0egmail_forwards\x18\xd9\x01 \x01(\x03HJ\x88\x01\x01\x12\x19\n\x0bgmail_saves\x18\xda\x01 \x01(\x03HK\x88\x01\x01\x12$\n\x16gmail_secondary_clicks\x18\xdb\x01 \x01(\x03HL\x88\x01\x01\x12*\n\x1cimpressions_from_store_reach\x18\xdc\x01 \x01(\x03HM\x88\x01\x01\x12\x19\n\x0bimpressions\x18\xdd\x01 \x01(\x03HN\x88\x01\x01\x12\x1e\n\x10interaction_rate\x18\xde\x01 \x01(\x01HO\x88\x01\x01\x12\x1a\n\x0cinteractions\x18\xdf\x01 \x01(\x03HP\x88\x01\x01\x12n\n\x17interaction_event_types\x18\x64 \x03(\x0e\x32M.google.ads.googleads.v16.enums.InteractionEventTypeEnum.InteractionEventType\x12 \n\x12invalid_click_rate\x18\xe0\x01 \x01(\x01HQ\x88\x01\x01\x12\x1c\n\x0einvalid_clicks\x18\xe1\x01 \x01(\x03HR\x88\x01\x01\x12\x1b\n\rmessage_chats\x18\xe2\x01 \x01(\x03HS\x88\x01\x01\x12!\n\x13message_impressions\x18\xe3\x01 \x01(\x03HT\x88\x01\x01\x12\x1f\n\x11message_chat_rate\x18\xe4\x01 \x01(\x01HU\x88\x01\x01\x12/\n!mobile_friendly_clicks_percentage\x18\xe5\x01 \x01(\x01HV\x88\x01\x01\x12\'\n\x19optimization_score_uplift\x18\xf7\x01 \x01(\x01HW\x88\x01\x01\x12$\n\x16optimization_score_url\x18\xf8\x01 \x01(\tHX\x88\x01\x01\x12\x1c\n\x0eorganic_clicks\x18\xe6\x01 \x01(\x03HY\x88\x01\x01\x12&\n\x18organic_clicks_per_query\x18\xe7\x01 \x01(\x01HZ\x88\x01\x01\x12!\n\x13organic_impressions\x18\xe8\x01 \x01(\x03H[\x88\x01\x01\x12+\n\x1dorganic_impressions_per_query\x18\xe9\x01 \x01(\x01H\\\x88\x01\x01\x12\x1d\n\x0forganic_queries\x18\xea\x01 \x01(\x03H]\x88\x01\x01\x12\"\n\x14percent_new_visitors\x18\xeb\x01 \x01(\x01H^\x88\x01\x01\x12\x19\n\x0bphone_calls\x18\xec\x01 \x01(\x03H_\x88\x01\x01\x12\x1f\n\x11phone_impressions\x18\xed\x01 \x01(\x03H`\x88\x01\x01\x12 \n\x12phone_through_rate\x18\xee\x01 \x01(\x01Ha\x88\x01\x01\x12\x1a\n\x0crelative_ctr\x18\xef\x01 \x01(\x01Hb\x88\x01\x01\x12\x32\n$search_absolute_top_impression_share\x18\x88\x01 \x01(\x01Hc\x88\x01\x01\x12>\n0search_budget_lost_absolute_top_impression_share\x18\x89\x01 \x01(\x01Hd\x88\x01\x01\x12\x31\n#search_budget_lost_impression_share\x18\x8a\x01 \x01(\x01He\x88\x01\x01\x12\x35\n\'search_budget_lost_top_impression_share\x18\x8b\x01 \x01(\x01Hf\x88\x01\x01\x12 \n\x12search_click_share\x18\x8c\x01 \x01(\x01Hg\x88\x01\x01\x12\x31\n#search_exact_match_impression_share\x18\x8d\x01 \x01(\x01Hh\x88\x01\x01\x12%\n\x17search_impression_share\x18\x8e\x01 \x01(\x01Hi\x88\x01\x01\x12<\n.search_rank_lost_absolute_top_impression_share\x18\x8f\x01 \x01(\x01Hj\x88\x01\x01\x12/\n!search_rank_lost_impression_share\x18\x90\x01 \x01(\x01Hk\x88\x01\x01\x12\x33\n%search_rank_lost_top_impression_share\x18\x91\x01 \x01(\x01Hl\x88\x01\x01\x12)\n\x1bsearch_top_impression_share\x18\x92\x01 \x01(\x01Hm\x88\x01\x01\x12O\n\rsearch_volume\x18\xa7\x02 \x01(\x0b\x32\x32.google.ads.googleads.v16.common.SearchVolumeRangeHn\x88\x01\x01\x12\x19\n\x0bspeed_score\x18\x93\x01 \x01(\x03Ho\x88\x01\x01\x12\'\n\x19\x61verage_target_cpa_micros\x18\xa2\x02 \x01(\x03Hp\x88\x01\x01\x12!\n\x13\x61verage_target_roas\x18\xfa\x01 \x01(\x01Hq\x88\x01\x01\x12\'\n\x19top_impression_percentage\x18\x94\x01 \x01(\x01Hr\x88\x01\x01\x12>\n0valid_accelerated_mobile_pages_clicks_percentage\x18\x95\x01 \x01(\x01Hs\x88\x01\x01\x12\'\n\x19value_per_all_conversions\x18\x96\x01 \x01(\x01Ht\x88\x01\x01\x12:\n,value_per_all_conversions_by_conversion_date\x18\xf4\x01 \x01(\x01Hu\x88\x01\x01\x12\"\n\x14value_per_conversion\x18\x97\x01 \x01(\x01Hv\x88\x01\x01\x12\x36\n(value_per_conversions_by_conversion_date\x18\xf5\x01 \x01(\x01Hw\x88\x01\x01\x12;\n-value_per_current_model_attributed_conversion\x18\x98\x01 \x01(\x01Hx\x88\x01\x01\x12&\n\x18video_quartile_p100_rate\x18\x84\x01 \x01(\x01Hy\x88\x01\x01\x12%\n\x17video_quartile_p25_rate\x18\x85\x01 \x01(\x01Hz\x88\x01\x01\x12%\n\x17video_quartile_p50_rate\x18\x86\x01 \x01(\x01H{\x88\x01\x01\x12%\n\x17video_quartile_p75_rate\x18\x87\x01 \x01(\x01H|\x88\x01\x01\x12\x1d\n\x0fvideo_view_rate\x18\x99\x01 \x01(\x01H}\x88\x01\x01\x12\x19\n\x0bvideo_views\x18\x9a\x01 \x01(\x03H~\x88\x01\x01\x12&\n\x18view_through_conversions\x18\x9b\x01 \x01(\x03H\x7f\x88\x01\x01\x12\x1f\n\x16sk_ad_network_installs\x18\xf6\x01 \x01(\x03\x12(\n\x1fsk_ad_network_total_conversions\x18\xa4\x02 \x01(\x03\x12#\n\x1apublisher_purchased_clicks\x18\x88\x02 \x01(\x03\x12!\n\x18publisher_organic_clicks\x18\x89\x02 \x01(\x03\x12!\n\x18publisher_unknown_clicks\x18\x8a\x02 \x01(\x03\x12@\n1all_conversions_from_location_asset_click_to_call\x18\x8b\x02 \x01(\x01H\x80\x01\x88\x01\x01\x12=\n.all_conversions_from_location_asset_directions\x18\x8c\x02 \x01(\x01H\x81\x01\x88\x01\x01\x12\x37\n(all_conversions_from_location_asset_menu\x18\x8d\x02 \x01(\x01H\x82\x01\x88\x01\x01\x12\x38\n)all_conversions_from_location_asset_order\x18\x8e\x02 \x01(\x01H\x83\x01\x88\x01\x01\x12\x43\n4all_conversions_from_location_asset_other_engagement\x18\x8f\x02 \x01(\x01H\x84\x01\x88\x01\x01\x12?\n0all_conversions_from_location_asset_store_visits\x18\x90\x02 \x01(\x01H\x85\x01\x88\x01\x01\x12:\n+all_conversions_from_location_asset_website\x18\x91\x02 \x01(\x01H\x86\x01\x88\x01\x01\x12\x43\n4eligible_impressions_from_location_asset_store_reach\x18\x92\x02 \x01(\x03H\x87\x01\x88\x01\x01\x12I\n:view_through_conversions_from_location_asset_click_to_call\x18\x93\x02 \x01(\x01H\x88\x01\x88\x01\x01\x12\x46\n7view_through_conversions_from_location_asset_directions\x18\x94\x02 \x01(\x01H\x89\x01\x88\x01\x01\x12@\n1view_through_conversions_from_location_asset_menu\x18\x95\x02 \x01(\x01H\x8a\x01\x88\x01\x01\x12\x41\n2view_through_conversions_from_location_asset_order\x18\x96\x02 \x01(\x01H\x8b\x01\x88\x01\x01\x12L\n=view_through_conversions_from_location_asset_other_engagement\x18\x97\x02 \x01(\x01H\x8c\x01\x88\x01\x01\x12H\n9view_through_conversions_from_location_asset_store_visits\x18\x98\x02 \x01(\x01H\x8d\x01\x88\x01\x01\x12\x43\n4view_through_conversions_from_location_asset_website\x18\x99\x02 \x01(\x01H\x8e\x01\x88\x01\x01\x12\x15\n\x06orders\x18\xa8\x02 \x01(\x01H\x8f\x01\x88\x01\x01\x12)\n\x1a\x61verage_order_value_micros\x18\xa9\x02 \x01(\x03H\x90\x01\x88\x01\x01\x12 \n\x11\x61verage_cart_size\x18\xaa\x02 \x01(\x01H\x91\x01\x88\x01\x01\x12(\n\x19\x63ost_of_goods_sold_micros\x18\xab\x02 \x01(\x03H\x92\x01\x88\x01\x01\x12\"\n\x13gross_profit_micros\x18\xac\x02 \x01(\x03H\x93\x01\x88\x01\x01\x12\"\n\x13gross_profit_margin\x18\xad\x02 \x01(\x01H\x94\x01\x88\x01\x01\x12\x1d\n\x0erevenue_micros\x18\xae\x02 \x01(\x03H\x95\x01\x88\x01\x01\x12\x19\n\nunits_sold\x18\xaf\x02 \x01(\x01H\x96\x01\x88\x01\x01\x12\x33\n$cross_sell_cost_of_goods_sold_micros\x18\xb0\x02 \x01(\x03H\x97\x01\x88\x01\x01\x12-\n\x1e\x63ross_sell_gross_profit_micros\x18\xb1\x02 \x01(\x03H\x98\x01\x88\x01\x01\x12(\n\x19\x63ross_sell_revenue_micros\x18\xb2\x02 \x01(\x03H\x99\x01\x88\x01\x01\x12$\n\x15\x63ross_sell_units_sold\x18\xb3\x02 \x01(\x01H\x9a\x01\x88\x01\x01\x12-\n\x1elead_cost_of_goods_sold_micros\x18\xb4\x02 \x01(\x03H\x9b\x01\x88\x01\x01\x12\'\n\x18lead_gross_profit_micros\x18\xb5\x02 \x01(\x03H\x9c\x01\x88\x01\x01\x12\"\n\x13lead_revenue_micros\x18\xb6\x02 \x01(\x03H\x9d\x01\x88\x01\x01\x12\x1e\n\x0flead_units_sold\x18\xb7\x02 \x01(\x01H\x9e\x01\x88\x01\x01\x12\x1b\n\x0cunique_users\x18\xbf\x02 \x01(\x03H\x9f\x01\x88\x01\x01\x12\x34\n%average_impression_frequency_per_user\x18\xc0\x02 \x01(\x01H\xa0\x01\x88\x01\x01\x42%\n#_absolute_top_impression_percentageB\x12\n\x10_active_view_cpmB\x12\n\x10_active_view_ctrB\x1a\n\x18_active_view_impressionsB\x1c\n\x1a_active_view_measurabilityB%\n#_active_view_measurable_cost_microsB%\n#_active_view_measurable_impressionsB\x1a\n\x18_active_view_viewabilityB)\n\'_all_conversions_from_interactions_rateB\x18\n\x16_all_conversions_valueB\"\n _all_new_customer_lifetime_valueB\x12\n\x10_all_conversionsB!\n\x1f_all_conversions_value_per_costB%\n#_all_conversions_from_click_to_callB\"\n _all_conversions_from_directionsB:\n8_all_conversions_from_interactions_value_per_interactionB\x1c\n\x1a_all_conversions_from_menuB\x1d\n\x1b_all_conversions_from_orderB(\n&_all_conversions_from_other_engagementB#\n!_all_conversions_from_store_visitB%\n#_all_conversions_from_store_websiteB<\n:_auction_insight_search_absolute_top_impression_percentageB*\n(_auction_insight_search_impression_shareB*\n(_auction_insight_search_outranking_shareB&\n$_auction_insight_search_overlap_rateB-\n+_auction_insight_search_position_above_rateB3\n1_auction_insight_search_top_impression_percentageB\x0f\n\r_average_costB\x0e\n\x0c_average_cpcB\x0e\n\x0c_average_cpeB\x0e\n\x0c_average_cpmB\x0e\n\x0c_average_cpvB\x15\n\x13_average_page_viewsB\x17\n\x15_average_time_on_siteB\x1c\n\x1a_benchmark_average_max_cpcB#\n!_biddable_app_install_conversionsB(\n&_biddable_app_post_install_conversionsB\x10\n\x0e_benchmark_ctrB\x0e\n\x0c_bounce_rateB\t\n\x07_clicksB\x12\n\x10_combined_clicksB\x1c\n\x1a_combined_clicks_per_queryB\x13\n\x11_combined_queriesB\'\n%_content_budget_lost_impression_shareB\x1b\n\x19_content_impression_shareB-\n+_conversion_last_received_request_date_timeB\"\n _conversion_last_conversion_dateB%\n#_content_rank_lost_impression_shareB%\n#_conversions_from_interactions_rateB\x14\n\x12_conversions_valueB\x1e\n\x1c_new_customer_lifetime_valueB\x1d\n\x1b_conversions_value_per_costB6\n4_conversions_from_interactions_value_per_interactionB\x0e\n\x0c_conversionsB\x0e\n\x0c_cost_microsB\x1b\n\x19_cost_per_all_conversionsB\x16\n\x14_cost_per_conversionB/\n-_cost_per_current_model_attributed_conversionB\x1b\n\x19_cross_device_conversionsB(\n&_cross_device_conversions_value_microsB\x06\n\x04_ctrB\'\n%_current_model_attributed_conversionsB>\n<_current_model_attributed_conversions_from_interactions_rateBO\nM_current_model_attributed_conversions_from_interactions_value_per_interactionB-\n+_current_model_attributed_conversions_valueB6\n4_current_model_attributed_conversions_value_per_costB\x12\n\x10_engagement_rateB\x0e\n\x0c_engagementsB\"\n _hotel_average_lead_value_microsB\x1f\n\x1d_hotel_commission_rate_microsB!\n\x1f_hotel_expected_commission_costB$\n\"_hotel_price_difference_percentageB\x1d\n\x1b_hotel_eligible_impressionsB\x1b\n\x19_historical_quality_scoreB\x11\n\x0f_gmail_forwardsB\x0e\n\x0c_gmail_savesB\x19\n\x17_gmail_secondary_clicksB\x1f\n\x1d_impressions_from_store_reachB\x0e\n\x0c_impressionsB\x13\n\x11_interaction_rateB\x0f\n\r_interactionsB\x15\n\x13_invalid_click_rateB\x11\n\x0f_invalid_clicksB\x10\n\x0e_message_chatsB\x16\n\x14_message_impressionsB\x14\n\x12_message_chat_rateB$\n\"_mobile_friendly_clicks_percentageB\x1c\n\x1a_optimization_score_upliftB\x19\n\x17_optimization_score_urlB\x11\n\x0f_organic_clicksB\x1b\n\x19_organic_clicks_per_queryB\x16\n\x14_organic_impressionsB \n\x1e_organic_impressions_per_queryB\x12\n\x10_organic_queriesB\x17\n\x15_percent_new_visitorsB\x0e\n\x0c_phone_callsB\x14\n\x12_phone_impressionsB\x15\n\x13_phone_through_rateB\x0f\n\r_relative_ctrB\'\n%_search_absolute_top_impression_shareB3\n1_search_budget_lost_absolute_top_impression_shareB&\n$_search_budget_lost_impression_shareB*\n(_search_budget_lost_top_impression_shareB\x15\n\x13_search_click_shareB&\n$_search_exact_match_impression_shareB\x1a\n\x18_search_impression_shareB1\n/_search_rank_lost_absolute_top_impression_shareB$\n\"_search_rank_lost_impression_shareB(\n&_search_rank_lost_top_impression_shareB\x1e\n\x1c_search_top_impression_shareB\x10\n\x0e_search_volumeB\x0e\n\x0c_speed_scoreB\x1c\n\x1a_average_target_cpa_microsB\x16\n\x14_average_target_roasB\x1c\n\x1a_top_impression_percentageB3\n1_valid_accelerated_mobile_pages_clicks_percentageB\x1c\n\x1a_value_per_all_conversionsB/\n-_value_per_all_conversions_by_conversion_dateB\x17\n\x15_value_per_conversionB+\n)_value_per_conversions_by_conversion_dateB0\n._value_per_current_model_attributed_conversionB\x1b\n\x19_video_quartile_p100_rateB\x1a\n\x18_video_quartile_p25_rateB\x1a\n\x18_video_quartile_p50_rateB\x1a\n\x18_video_quartile_p75_rateB\x12\n\x10_video_view_rateB\x0e\n\x0c_video_viewsB\x1b\n\x19_view_through_conversionsB4\n2_all_conversions_from_location_asset_click_to_callB1\n/_all_conversions_from_location_asset_directionsB+\n)_all_conversions_from_location_asset_menuB,\n*_all_conversions_from_location_asset_orderB7\n5_all_conversions_from_location_asset_other_engagementB3\n1_all_conversions_from_location_asset_store_visitsB.\n,_all_conversions_from_location_asset_websiteB7\n5_eligible_impressions_from_location_asset_store_reachB=\n;_view_through_conversions_from_location_asset_click_to_callB:\n8_view_through_conversions_from_location_asset_directionsB4\n2_view_through_conversions_from_location_asset_menuB5\n3_view_through_conversions_from_location_asset_orderB@\n>_view_through_conversions_from_location_asset_other_engagementB<\n:_view_through_conversions_from_location_asset_store_visitsB7\n5_view_through_conversions_from_location_asset_websiteB\t\n\x07_ordersB\x1d\n\x1b_average_order_value_microsB\x14\n\x12_average_cart_sizeB\x1c\n\x1a_cost_of_goods_sold_microsB\x16\n\x14_gross_profit_microsB\x16\n\x14_gross_profit_marginB\x11\n\x0f_revenue_microsB\r\n\x0b_units_soldB\'\n%_cross_sell_cost_of_goods_sold_microsB!\n\x1f_cross_sell_gross_profit_microsB\x1c\n\x1a_cross_sell_revenue_microsB\x18\n\x16_cross_sell_units_soldB!\n\x1f_lead_cost_of_goods_sold_microsB\x1b\n\x19_lead_gross_profit_microsB\x16\n\x14_lead_revenue_microsB\x12\n\x10_lead_units_soldB\x0f\n\r_unique_usersB(\n&_average_impression_frequency_per_user\"G\n\x11SearchVolumeRange\x12\x10\n\x03min\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x10\n\x03max\x18\x02 \x01(\x03H\x01\x88\x01\x01\x42\x06\n\x04_minB\x06\n\x04_maxB\xec\x01\n#com.google.ads.googleads.v16.commonB\x0cMetricsProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Metrics").msgclass + SearchVolumeRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.SearchVolumeRange").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/offline_user_data_pb.rb b/lib/google/ads/google_ads/v16/common/offline_user_data_pb.rb new file mode 100644 index 000000000..ec6d24dec --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/offline_user_data_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/offline_user_data.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/consent_pb' +require 'google/ads/google_ads/v16/enums/user_identifier_source_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n7google/ads/googleads/v16/common/offline_user_data.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a-google/ads/googleads/v16/common/consent.proto\x1a;google/ads/googleads/v16/enums/user_identifier_source.proto\x1a\x1fgoogle/api/field_behavior.proto\"\xd0\x02\n\x16OfflineUserAddressInfo\x12\x1e\n\x11hashed_first_name\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x1d\n\x10hashed_last_name\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04\x63ity\x18\t \x01(\tH\x02\x88\x01\x01\x12\x12\n\x05state\x18\n \x01(\tH\x03\x88\x01\x01\x12\x19\n\x0c\x63ountry_code\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0bpostal_code\x18\x0c \x01(\tH\x05\x88\x01\x01\x12\"\n\x15hashed_street_address\x18\r \x01(\tH\x06\x88\x01\x01\x42\x14\n\x12_hashed_first_nameB\x13\n\x11_hashed_last_nameB\x07\n\x05_cityB\x08\n\x06_stateB\x0f\n\r_country_codeB\x0e\n\x0c_postal_codeB\x18\n\x16_hashed_street_address\"\xc9\x02\n\x0eUserIdentifier\x12m\n\x16user_identifier_source\x18\x06 \x01(\x0e\x32M.google.ads.googleads.v16.enums.UserIdentifierSourceEnum.UserIdentifierSource\x12\x16\n\x0chashed_email\x18\x07 \x01(\tH\x00\x12\x1d\n\x13hashed_phone_number\x18\x08 \x01(\tH\x00\x12\x13\n\tmobile_id\x18\t \x01(\tH\x00\x12\x1d\n\x13third_party_user_id\x18\n \x01(\tH\x00\x12O\n\x0c\x61\x64\x64ress_info\x18\x05 \x01(\x0b\x32\x37.google.ads.googleads.v16.common.OfflineUserAddressInfoH\x00\x42\x0c\n\nidentifier\"\xe0\x03\n\x14TransactionAttribute\x12\"\n\x15transaction_date_time\x18\x08 \x01(\tH\x00\x88\x01\x01\x12&\n\x19transaction_amount_micros\x18\t \x01(\x01H\x01\x88\x01\x01\x12\x1a\n\rcurrency_code\x18\n \x01(\tH\x02\x88\x01\x01\x12\x1e\n\x11\x63onversion_action\x18\x0b \x01(\tH\x03\x88\x01\x01\x12\x15\n\x08order_id\x18\x0c \x01(\tH\x04\x88\x01\x01\x12H\n\x0fstore_attribute\x18\x06 \x01(\x0b\x32/.google.ads.googleads.v16.common.StoreAttribute\x12\x19\n\x0c\x63ustom_value\x18\r \x01(\tH\x05\x88\x01\x01\x12\x46\n\x0eitem_attribute\x18\x0e \x01(\x0b\x32..google.ads.googleads.v16.common.ItemAttributeB\x18\n\x16_transaction_date_timeB\x1c\n\x1a_transaction_amount_microsB\x10\n\x0e_currency_codeB\x14\n\x12_conversion_actionB\x0b\n\t_order_idB\x0f\n\r_custom_value\"8\n\x0eStoreAttribute\x12\x17\n\nstore_code\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_store_code\"\x89\x01\n\rItemAttribute\x12\x0f\n\x07item_id\x18\x01 \x01(\t\x12\x18\n\x0bmerchant_id\x18\x02 \x01(\x03H\x00\x88\x01\x01\x12\x14\n\x0c\x63ountry_code\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12\x10\n\x08quantity\x18\x05 \x01(\x03\x42\x0e\n\x0c_merchant_id\"\xbf\x02\n\x08UserData\x12I\n\x10user_identifiers\x18\x01 \x03(\x0b\x32/.google.ads.googleads.v16.common.UserIdentifier\x12T\n\x15transaction_attribute\x18\x02 \x01(\x0b\x32\x35.google.ads.googleads.v16.common.TransactionAttribute\x12\x46\n\x0euser_attribute\x18\x03 \x01(\x0b\x32..google.ads.googleads.v16.common.UserAttribute\x12>\n\x07\x63onsent\x18\x04 \x01(\x0b\x32(.google.ads.googleads.v16.common.ConsentH\x00\x88\x01\x01\x42\n\n\x08_consent\"\x8c\x04\n\rUserAttribute\x12\"\n\x15lifetime_value_micros\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\"\n\x15lifetime_value_bucket\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x1f\n\x17last_purchase_date_time\x18\x03 \x01(\t\x12\x1e\n\x16\x61verage_purchase_count\x18\x04 \x01(\x05\x12%\n\x1d\x61verage_purchase_value_micros\x18\x05 \x01(\x03\x12\x1d\n\x15\x61\x63quisition_date_time\x18\x06 \x01(\t\x12O\n\x10shopping_loyalty\x18\x07 \x01(\x0b\x32\x30.google.ads.googleads.v16.common.ShoppingLoyaltyH\x02\x88\x01\x01\x12\x1c\n\x0flifecycle_stage\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18\x66irst_purchase_date_time\x18\t \x01(\tB\x03\xe0\x41\x01\x12M\n\x0f\x65vent_attribute\x18\n \x03(\x0b\x32/.google.ads.googleads.v16.common.EventAttributeB\x03\xe0\x41\x01\x42\x18\n\x16_lifetime_value_microsB\x18\n\x16_lifetime_value_bucketB\x13\n\x11_shopping_loyalty\"\x94\x01\n\x0e\x45ventAttribute\x12\x12\n\x05\x65vent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x65vent_date_time\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12P\n\x0eitem_attribute\x18\x03 \x03(\x0b\x32\x33.google.ads.googleads.v16.common.EventItemAttributeB\x03\xe0\x41\x02\"*\n\x12\x45ventItemAttribute\x12\x14\n\x07item_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\"=\n\x0fShoppingLoyalty\x12\x19\n\x0cloyalty_tier\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_loyalty_tier\"\x91\x01\n\x1d\x43ustomerMatchUserListMetadata\x12\x16\n\tuser_list\x18\x02 \x01(\tH\x00\x88\x01\x01\x12>\n\x07\x63onsent\x18\x03 \x01(\x0b\x32(.google.ads.googleads.v16.common.ConsentH\x01\x88\x01\x01\x42\x0c\n\n_user_listB\n\n\x08_consent\"\x97\x02\n\x12StoreSalesMetadata\x12\x1d\n\x10loyalty_fraction\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12(\n\x1btransaction_upload_fraction\x18\x06 \x01(\x01H\x01\x88\x01\x01\x12\x17\n\ncustom_key\x18\x07 \x01(\tH\x02\x88\x01\x01\x12[\n\x14third_party_metadata\x18\x03 \x01(\x0b\x32=.google.ads.googleads.v16.common.StoreSalesThirdPartyMetadataB\x13\n\x11_loyalty_fractionB\x1e\n\x1c_transaction_upload_fractionB\r\n\x0b_custom_key\"\x98\x03\n\x1cStoreSalesThirdPartyMetadata\x12(\n\x1b\x61\x64vertiser_upload_date_time\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\'\n\x1avalid_transaction_fraction\x18\x08 \x01(\x01H\x01\x88\x01\x01\x12#\n\x16partner_match_fraction\x18\t \x01(\x01H\x02\x88\x01\x01\x12$\n\x17partner_upload_fraction\x18\n \x01(\x01H\x03\x88\x01\x01\x12\"\n\x15\x62ridge_map_version_id\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x17\n\npartner_id\x18\x0c \x01(\x03H\x05\x88\x01\x01\x42\x1e\n\x1c_advertiser_upload_date_timeB\x1d\n\x1b_valid_transaction_fractionB\x19\n\x17_partner_match_fractionB\x1a\n\x18_partner_upload_fractionB\x18\n\x16_bridge_map_version_idB\r\n\x0b_partner_idB\xf4\x01\n#com.google.ads.googleads.v16.commonB\x14OfflineUserDataProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.Consent", "google/ads/googleads/v16/common/consent.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + OfflineUserAddressInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.OfflineUserAddressInfo").msgclass + UserIdentifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserIdentifier").msgclass + TransactionAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TransactionAttribute").msgclass + StoreAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.StoreAttribute").msgclass + ItemAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ItemAttribute").msgclass + UserData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserData").msgclass + UserAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserAttribute").msgclass + EventAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.EventAttribute").msgclass + EventItemAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.EventItemAttribute").msgclass + ShoppingLoyalty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.ShoppingLoyalty").msgclass + CustomerMatchUserListMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CustomerMatchUserListMetadata").msgclass + StoreSalesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.StoreSalesMetadata").msgclass + StoreSalesThirdPartyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.StoreSalesThirdPartyMetadata").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/policy_pb.rb b/lib/google/ads/google_ads/v16/common/policy_pb.rb new file mode 100644 index 000000000..868603d28 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/policy_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/policy.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/policy_topic_entry_type_pb' +require 'google/ads/google_ads/v16/enums/policy_topic_evidence_destination_mismatch_url_type_pb' +require 'google/ads/google_ads/v16/enums/policy_topic_evidence_destination_not_working_device_pb' +require 'google/ads/google_ads/v16/enums/policy_topic_evidence_destination_not_working_dns_error_type_pb' + + +descriptor_data = "\n,google/ads/googleads/v16/common/policy.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x88\x01\x01\x12\x15\n\x07quarter\x18\x80\x01 \x01(\tH?\x88\x01\x01\x12g\n\x13recommendation_type\x18\x8c\x01 \x01(\x0e\x32I.google.ads.googleads.v16.enums.RecommendationTypeEnum.RecommendationType\x12\x84\x01\n\x1fsearch_engine_results_page_type\x18\x46 \x01(\x0e\x32[.google.ads.googleads.v16.enums.SearchEngineResultsPageTypeEnum.SearchEngineResultsPageType\x12 \n\x12search_subcategory\x18\x9b\x01 \x01(\tH@\x88\x01\x01\x12\x19\n\x0bsearch_term\x18\x9c\x01 \x01(\tHA\x88\x01\x01\x12k\n\x16search_term_match_type\x18\x16 \x01(\x0e\x32K.google.ads.googleads.v16.enums.SearchTermMatchTypeEnum.SearchTermMatchType\x12;\n\x04slot\x18\x17 \x01(\x0e\x32-.google.ads.googleads.v16.enums.SlotEnum.Slot\x12\x9d\x01\n\'conversion_value_rule_primary_dimension\x18\x8a\x01 \x01(\x0e\x32k.google.ads.googleads.v16.enums.ConversionValueRulePrimaryDimensionEnum.ConversionValueRulePrimaryDimension\x12\x15\n\x07webpage\x18\x81\x01 \x01(\tHB\x88\x01\x01\x12\x12\n\x04week\x18\x82\x01 \x01(\tHC\x88\x01\x01\x12\x12\n\x04year\x18\x83\x01 \x01(\x05HD\x88\x01\x01\x12,\n\x1esk_ad_network_conversion_value\x18\x89\x01 \x01(\x03HE\x88\x01\x01\x12m\n\x17sk_ad_network_user_type\x18\x8d\x01 \x01(\x0e\x32K.google.ads.googleads.v16.enums.SkAdNetworkUserTypeEnum.SkAdNetworkUserType\x12w\n\x1bsk_ad_network_ad_event_type\x18\x8e\x01 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.SkAdNetworkAdEventTypeEnum.SkAdNetworkAdEventType\x12]\n\x18sk_ad_network_source_app\x18\x8f\x01 \x01(\x0b\x32\x35.google.ads.googleads.v16.common.SkAdNetworkSourceAppHF\x88\x01\x01\x12\x88\x01\n sk_ad_network_attribution_credit\x18\x90\x01 \x01(\x0e\x32].google.ads.googleads.v16.enums.SkAdNetworkAttributionCreditEnum.SkAdNetworkAttributionCredit\x12\x95\x01\n%sk_ad_network_coarse_conversion_value\x18\x97\x01 \x01(\x0e\x32\x65.google.ads.googleads.v16.enums.SkAdNetworkCoarseConversionValueEnum.SkAdNetworkCoarseConversionValue\x12)\n\x1bsk_ad_network_source_domain\x18\x98\x01 \x01(\tHG\x88\x01\x01\x12s\n\x19sk_ad_network_source_type\x18\x99\x01 \x01(\x0e\x32O.google.ads.googleads.v16.enums.SkAdNetworkSourceTypeEnum.SkAdNetworkSourceType\x12\x33\n%sk_ad_network_postback_sequence_index\x18\x9a\x01 \x01(\x03HH\x88\x01\x01\x12_\n\x18\x61sset_interaction_target\x18\x8b\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.common.AssetInteractionTargetHI\x88\x01\x01\x12\xa8\x01\n\x1enew_versus_returning_customers\x18\xa0\x01 \x01(\x0e\x32\x7f.google.ads.googleads.v16.enums.ConvertingUserPriorEngagementTypeAndLtvBucketEnum.ConvertingUserPriorEngagementTypeAndLtvBucketB\x16\n\x14_activity_account_idB\x10\n\x0e_activity_cityB\x13\n\x11_activity_countryB\x12\n\x10_activity_ratingB\x11\n\x0f_activity_stateB\x17\n\x15_external_activity_idB\x0b\n\t_ad_groupB\x0e\n\x0c_asset_groupB\x19\n\x17_auction_insight_domainB\x0b\n\t_campaignB\x14\n\x12_conversion_actionB\x19\n\x17_conversion_action_nameB\x18\n\x16_conversion_adjustmentB\x07\n\x05_dateB\x15\n\x13_geo_target_airportB\x14\n\x12_geo_target_cantonB\x12\n\x10_geo_target_cityB\x15\n\x13_geo_target_countryB\x14\n\x12_geo_target_countyB\x16\n\x14_geo_target_districtB\x13\n\x11_geo_target_metroB$\n\"_geo_target_most_specific_locationB\x19\n\x17_geo_target_postal_codeB\x16\n\x14_geo_target_provinceB\x14\n\x12_geo_target_regionB\x13\n\x11_geo_target_stateB\x1c\n\x1a_hotel_booking_window_daysB\x12\n\x10_hotel_center_idB\x16\n\x14_hotel_check_in_dateB\r\n\x0b_hotel_cityB\x0e\n\x0c_hotel_classB\x10\n\x0e_hotel_countryB\x17\n\x15_hotel_length_of_stayB\x15\n\x13_hotel_rate_rule_idB\x0e\n\x0c_hotel_stateB\x07\n\x05_hourB \n\x1e_interaction_on_this_extensionB\x08\n\x06_monthB\x13\n\x11_partner_hotel_idB\x18\n\x16_product_aggregator_idB\x1a\n\x18_product_category_level1B\x1a\n\x18_product_category_level2B\x1a\n\x18_product_category_level3B\x1a\n\x18_product_category_level4B\x1a\n\x18_product_category_level5B\x10\n\x0e_product_brandB\x12\n\x10_product_countryB\x1c\n\x1a_product_custom_attribute0B\x1c\n\x1a_product_custom_attribute1B\x1c\n\x1a_product_custom_attribute2B\x1c\n\x1a_product_custom_attribute3B\x1c\n\x1a_product_custom_attribute4B\x15\n\x13_product_feed_labelB\x12\n\x10_product_item_idB\x13\n\x11_product_languageB\x16\n\x14_product_merchant_idB\x13\n\x11_product_store_idB\x10\n\x0e_product_titleB\x12\n\x10_product_type_l1B\x12\n\x10_product_type_l2B\x12\n\x10_product_type_l3B\x12\n\x10_product_type_l4B\x12\n\x10_product_type_l5B\n\n\x08_quarterB\x15\n\x13_search_subcategoryB\x0e\n\x0c_search_termB\n\n\x08_webpageB\x07\n\x05_weekB\x07\n\x05_yearB!\n\x1f_sk_ad_network_conversion_valueB\x1b\n\x19_sk_ad_network_source_appB\x1e\n\x1c_sk_ad_network_source_domainB(\n&_sk_ad_network_postback_sequence_indexB\x1b\n\x19_asset_interaction_target\"}\n\x07Keyword\x12\x1f\n\x12\x61\x64_group_criterion\x18\x03 \x01(\tH\x00\x88\x01\x01\x12:\n\x04info\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x15\n\x13_ad_group_criterion\"\xba\x01\n\x1f\x42udgetCampaignAssociationStatus\x12\x15\n\x08\x63\x61mpaign\x18\x01 \x01(\tH\x00\x88\x01\x01\x12s\n\x06status\x18\x02 \x01(\x0e\x32\x63.google.ads.googleads.v16.enums.BudgetCampaignAssociationStatusEnum.BudgetCampaignAssociationStatusB\x0b\n\t_campaign\"J\n\x16\x41ssetInteractionTarget\x12\r\n\x05\x61sset\x18\x01 \x01(\t\x12!\n\x19interaction_on_this_asset\x18\x02 \x01(\x08\"`\n\x14SkAdNetworkSourceApp\x12(\n\x1bsk_ad_network_source_app_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x1e\n\x1c_sk_ad_network_source_app_idB\xed\x01\n#com.google.ads.googleads.v16.commonB\rSegmentsProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.KeywordInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + Segments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Segments").msgclass + Keyword = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Keyword").msgclass + BudgetCampaignAssociationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BudgetCampaignAssociationStatus").msgclass + AssetInteractionTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.AssetInteractionTarget").msgclass + SkAdNetworkSourceApp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.SkAdNetworkSourceApp").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/simulation_pb.rb b/lib/google/ads/google_ads/v16/common/simulation_pb.rb new file mode 100644 index 000000000..b75aef4ce --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/simulation_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/simulation.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/ads/googleads/v16/common/simulation.proto\x12\x1fgoogle.ads.googleads.v16.common\"c\n\x19\x43pcBidSimulationPointList\x12\x46\n\x06points\x18\x01 \x03(\x0b\x32\x36.google.ads.googleads.v16.common.CpcBidSimulationPoint\"c\n\x19\x43pvBidSimulationPointList\x12\x46\n\x06points\x18\x01 \x03(\x0b\x32\x36.google.ads.googleads.v16.common.CpvBidSimulationPoint\"i\n\x1cTargetCpaSimulationPointList\x12I\n\x06points\x18\x01 \x03(\x0b\x32\x39.google.ads.googleads.v16.common.TargetCpaSimulationPoint\"k\n\x1dTargetRoasSimulationPointList\x12J\n\x06points\x18\x01 \x03(\x0b\x32:.google.ads.googleads.v16.common.TargetRoasSimulationPoint\"q\n PercentCpcBidSimulationPointList\x12M\n\x06points\x18\x01 \x03(\x0b\x32=.google.ads.googleads.v16.common.PercentCpcBidSimulationPoint\"c\n\x19\x42udgetSimulationPointList\x12\x46\n\x06points\x18\x01 \x03(\x0b\x32\x36.google.ads.googleads.v16.common.BudgetSimulationPoint\"\x81\x01\n(TargetImpressionShareSimulationPointList\x12U\n\x06points\x18\x01 \x03(\x0b\x32\x45.google.ads.googleads.v16.common.TargetImpressionShareSimulationPoint\"\xcc\x03\n\x15\x43pcBidSimulationPoint\x12%\n\x1drequired_budget_amount_micros\x18\x11 \x01(\x03\x12!\n\x14\x62iddable_conversions\x18\t \x01(\x01H\x01\x88\x01\x01\x12\'\n\x1a\x62iddable_conversions_value\x18\n \x01(\x01H\x02\x88\x01\x01\x12\x13\n\x06\x63licks\x18\x0b \x01(\x03H\x03\x88\x01\x01\x12\x18\n\x0b\x63ost_micros\x18\x0c \x01(\x03H\x04\x88\x01\x01\x12\x18\n\x0bimpressions\x18\r \x01(\x03H\x05\x88\x01\x01\x12!\n\x14top_slot_impressions\x18\x0e \x01(\x03H\x06\x88\x01\x01\x12\x18\n\x0e\x63pc_bid_micros\x18\x0f \x01(\x03H\x00\x12\"\n\x18\x63pc_bid_scaling_modifier\x18\x10 \x01(\x01H\x00\x42\x1a\n\x18\x63pc_simulation_key_valueB\x17\n\x15_biddable_conversionsB\x1d\n\x1b_biddable_conversions_valueB\t\n\x07_clicksB\x0e\n\x0c_cost_microsB\x0e\n\x0c_impressionsB\x17\n\x15_top_slot_impressions\"\xb9\x01\n\x15\x43pvBidSimulationPoint\x12\x1b\n\x0e\x63pv_bid_micros\x18\x05 \x01(\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x63ost_micros\x18\x06 \x01(\x03H\x01\x88\x01\x01\x12\x18\n\x0bimpressions\x18\x07 \x01(\x03H\x02\x88\x01\x01\x12\x12\n\x05views\x18\x08 \x01(\x03H\x03\x88\x01\x01\x42\x11\n\x0f_cpv_bid_microsB\x0e\n\x0c_cost_microsB\x0e\n\x0c_impressionsB\x08\n\x06_views\"\xb6\x04\n\x18TargetCpaSimulationPoint\x12%\n\x1drequired_budget_amount_micros\x18\x13 \x01(\x03\x12!\n\x14\x62iddable_conversions\x18\t \x01(\x01H\x01\x88\x01\x01\x12\'\n\x1a\x62iddable_conversions_value\x18\n \x01(\x01H\x02\x88\x01\x01\x12\x14\n\x0c\x61pp_installs\x18\x0f \x01(\x01\x12\x16\n\x0ein_app_actions\x18\x10 \x01(\x01\x12\x13\n\x06\x63licks\x18\x0b \x01(\x03H\x03\x88\x01\x01\x12\x18\n\x0b\x63ost_micros\x18\x0c \x01(\x03H\x04\x88\x01\x01\x12\x18\n\x0bimpressions\x18\r \x01(\x03H\x05\x88\x01\x01\x12!\n\x14top_slot_impressions\x18\x0e \x01(\x03H\x06\x88\x01\x01\x12\x19\n\x0cinteractions\x18\x14 \x01(\x03H\x07\x88\x01\x01\x12\x1b\n\x11target_cpa_micros\x18\x11 \x01(\x03H\x00\x12%\n\x1btarget_cpa_scaling_modifier\x18\x12 \x01(\x01H\x00\x42!\n\x1ftarget_cpa_simulation_key_valueB\x17\n\x15_biddable_conversionsB\x1d\n\x1b_biddable_conversions_valueB\t\n\x07_clicksB\x0e\n\x0c_cost_microsB\x0e\n\x0c_impressionsB\x17\n\x15_top_slot_impressionsB\x0f\n\r_interactions\"\xa0\x03\n\x19TargetRoasSimulationPoint\x12\x18\n\x0btarget_roas\x18\x08 \x01(\x01H\x00\x88\x01\x01\x12%\n\x1drequired_budget_amount_micros\x18\x0f \x01(\x03\x12!\n\x14\x62iddable_conversions\x18\t \x01(\x01H\x01\x88\x01\x01\x12\'\n\x1a\x62iddable_conversions_value\x18\n \x01(\x01H\x02\x88\x01\x01\x12\x13\n\x06\x63licks\x18\x0b \x01(\x03H\x03\x88\x01\x01\x12\x18\n\x0b\x63ost_micros\x18\x0c \x01(\x03H\x04\x88\x01\x01\x12\x18\n\x0bimpressions\x18\r \x01(\x03H\x05\x88\x01\x01\x12!\n\x14top_slot_impressions\x18\x0e \x01(\x03H\x06\x88\x01\x01\x42\x0e\n\x0c_target_roasB\x17\n\x15_biddable_conversionsB\x1d\n\x1b_biddable_conversions_valueB\t\n\x07_clicksB\x0e\n\x0c_cost_microsB\x0e\n\x0c_impressionsB\x17\n\x15_top_slot_impressions\"\x92\x03\n\x1cPercentCpcBidSimulationPoint\x12#\n\x16percent_cpc_bid_micros\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12!\n\x14\x62iddable_conversions\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\'\n\x1a\x62iddable_conversions_value\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x13\n\x06\x63licks\x18\x04 \x01(\x03H\x03\x88\x01\x01\x12\x18\n\x0b\x63ost_micros\x18\x05 \x01(\x03H\x04\x88\x01\x01\x12\x18\n\x0bimpressions\x18\x06 \x01(\x03H\x05\x88\x01\x01\x12!\n\x14top_slot_impressions\x18\x07 \x01(\x03H\x06\x88\x01\x01\x42\x19\n\x17_percent_cpc_bid_microsB\x17\n\x15_biddable_conversionsB\x1d\n\x1b_biddable_conversions_valueB\t\n\x07_clicksB\x0e\n\x0c_cost_microsB\x0e\n\x0c_impressionsB\x17\n\x15_top_slot_impressions\"\x8e\x02\n\x15\x42udgetSimulationPoint\x12\x1c\n\x14\x62udget_amount_micros\x18\x01 \x01(\x03\x12\'\n\x1frequired_cpc_bid_ceiling_micros\x18\x02 \x01(\x03\x12\x1c\n\x14\x62iddable_conversions\x18\x03 \x01(\x01\x12\"\n\x1a\x62iddable_conversions_value\x18\x04 \x01(\x01\x12\x0e\n\x06\x63licks\x18\x05 \x01(\x03\x12\x13\n\x0b\x63ost_micros\x18\x06 \x01(\x03\x12\x13\n\x0bimpressions\x18\x07 \x01(\x03\x12\x1c\n\x14top_slot_impressions\x18\x08 \x01(\x03\x12\x14\n\x0cinteractions\x18\t \x01(\x03\"\xda\x02\n$TargetImpressionShareSimulationPoint\x12&\n\x1etarget_impression_share_micros\x18\x01 \x01(\x03\x12\'\n\x1frequired_cpc_bid_ceiling_micros\x18\x02 \x01(\x03\x12%\n\x1drequired_budget_amount_micros\x18\x03 \x01(\x03\x12\x1c\n\x14\x62iddable_conversions\x18\x04 \x01(\x01\x12\"\n\x1a\x62iddable_conversions_value\x18\x05 \x01(\x01\x12\x0e\n\x06\x63licks\x18\x06 \x01(\x03\x12\x13\n\x0b\x63ost_micros\x18\x07 \x01(\x03\x12\x13\n\x0bimpressions\x18\x08 \x01(\x03\x12\x1c\n\x14top_slot_impressions\x18\t \x01(\x03\x12 \n\x18\x61\x62solute_top_impressions\x18\n \x01(\x03\x42\xef\x01\n#com.google.ads.googleads.v16.commonB\x0fSimulationProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + CpcBidSimulationPointList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CpcBidSimulationPointList").msgclass + CpvBidSimulationPointList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CpvBidSimulationPointList").msgclass + TargetCpaSimulationPointList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetCpaSimulationPointList").msgclass + TargetRoasSimulationPointList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetRoasSimulationPointList").msgclass + PercentCpcBidSimulationPointList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PercentCpcBidSimulationPointList").msgclass + BudgetSimulationPointList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BudgetSimulationPointList").msgclass + TargetImpressionShareSimulationPointList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetImpressionShareSimulationPointList").msgclass + CpcBidSimulationPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CpcBidSimulationPoint").msgclass + CpvBidSimulationPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CpvBidSimulationPoint").msgclass + TargetCpaSimulationPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetCpaSimulationPoint").msgclass + TargetRoasSimulationPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetRoasSimulationPoint").msgclass + PercentCpcBidSimulationPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.PercentCpcBidSimulationPoint").msgclass + BudgetSimulationPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BudgetSimulationPoint").msgclass + TargetImpressionShareSimulationPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetImpressionShareSimulationPoint").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/tag_snippet_pb.rb b/lib/google/ads/google_ads/v16/common/tag_snippet_pb.rb new file mode 100644 index 000000000..bdda50335 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/tag_snippet_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/tag_snippet.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/tracking_code_page_format_pb' +require 'google/ads/google_ads/v16/enums/tracking_code_type_pb' + + +descriptor_data = "\n1google/ads/googleads/v16/common/tag_snippet.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a>google/ads/googleads/v16/enums/tracking_code_page_format.proto\x1a\x37google/ads/googleads/v16/enums/tracking_code_type.proto\"\xa9\x02\n\nTagSnippet\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.TrackingCodeTypeEnum.TrackingCodeType\x12\x66\n\x0bpage_format\x18\x02 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.TrackingCodePageFormatEnum.TrackingCodePageFormat\x12\x1c\n\x0fglobal_site_tag\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\revent_snippet\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\x12\n\x10_global_site_tagB\x10\n\x0e_event_snippetB\xef\x01\n#com.google.ads.googleads.v16.commonB\x0fTagSnippetProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + TagSnippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TagSnippet").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/targeting_setting_pb.rb b/lib/google/ads/google_ads/v16/common/targeting_setting_pb.rb new file mode 100644 index 000000000..55a20373f --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/targeting_setting_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/targeting_setting.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/targeting_dimension_pb' + + +descriptor_data = "\n7google/ads/googleads/v16/common/targeting_setting.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x38google/ads/googleads/v16/enums/targeting_dimension.proto\"\xc7\x01\n\x10TargetingSetting\x12O\n\x13target_restrictions\x18\x01 \x03(\x0b\x32\x32.google.ads.googleads.v16.common.TargetRestriction\x12\x62\n\x1dtarget_restriction_operations\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.common.TargetRestrictionOperation\"\x9f\x01\n\x11TargetRestriction\x12\x66\n\x13targeting_dimension\x18\x01 \x01(\x0e\x32I.google.ads.googleads.v16.enums.TargetingDimensionEnum.TargetingDimension\x12\x15\n\x08\x62id_only\x18\x03 \x01(\x08H\x00\x88\x01\x01\x42\x0b\n\t_bid_only\"\xf6\x01\n\x1aTargetRestrictionOperation\x12V\n\x08operator\x18\x01 \x01(\x0e\x32\x44.google.ads.googleads.v16.common.TargetRestrictionOperation.Operator\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.google.ads.googleads.v16.common.TargetRestriction\"=\n\x08Operator\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x07\n\x03\x41\x44\x44\x10\x02\x12\n\n\x06REMOVE\x10\x03\x42\xf5\x01\n#com.google.ads.googleads.v16.commonB\x15TargetingSettingProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + TargetingSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetingSetting").msgclass + TargetRestriction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetRestriction").msgclass + TargetRestrictionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetRestrictionOperation").msgclass + TargetRestrictionOperation::Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TargetRestrictionOperation.Operator").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/text_label_pb.rb b/lib/google/ads/google_ads/v16/common/text_label_pb.rb new file mode 100644 index 000000000..c439660c0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/text_label_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/text_label.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/ads/googleads/v16/common/text_label.proto\x12\x1fgoogle.ads.googleads.v16.common\"i\n\tTextLabel\x12\x1d\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x13\n\x11_background_colorB\x0e\n\x0c_descriptionB\xee\x01\n#com.google.ads.googleads.v16.commonB\x0eTextLabelProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + TextLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.TextLabel").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/url_collection_pb.rb b/lib/google/ads/google_ads/v16/common/url_collection_pb.rb new file mode 100644 index 000000000..239fb8337 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/url_collection_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/url_collection.proto + +require 'google/protobuf' + + +descriptor_data = "\n4google/ads/googleads/v16/common/url_collection.proto\x12\x1fgoogle.ads.googleads.v16.common\"\xb2\x01\n\rUrlCollection\x12\x1e\n\x11url_collection_id\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x12\n\nfinal_urls\x18\x06 \x03(\t\x12\x19\n\x11\x66inal_mobile_urls\x18\x07 \x03(\t\x12\"\n\x15tracking_url_template\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\x14\n\x12_url_collection_idB\x18\n\x16_tracking_url_templateB\xf2\x01\n#com.google.ads.googleads.v16.commonB\x12UrlCollectionProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + UrlCollection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UrlCollection").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/user_lists_pb.rb b/lib/google/ads/google_ads/v16/common/user_lists_pb.rb new file mode 100644 index 000000000..a40faebd2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/user_lists_pb.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/user_lists.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/customer_match_upload_key_type_pb' +require 'google/ads/google_ads/v16/enums/lookalike_expansion_level_pb' +require 'google/ads/google_ads/v16/enums/user_list_crm_data_source_type_pb' +require 'google/ads/google_ads/v16/enums/user_list_date_rule_item_operator_pb' +require 'google/ads/google_ads/v16/enums/user_list_flexible_rule_operator_pb' +require 'google/ads/google_ads/v16/enums/user_list_logical_rule_operator_pb' +require 'google/ads/google_ads/v16/enums/user_list_number_rule_item_operator_pb' +require 'google/ads/google_ads/v16/enums/user_list_prepopulation_status_pb' +require 'google/ads/google_ads/v16/enums/user_list_rule_type_pb' +require 'google/ads/google_ads/v16/enums/user_list_string_rule_item_operator_pb' + + +descriptor_data = "\n0google/ads/googleads/v16/common/user_lists.proto\x12\x1fgoogle.ads.googleads.v16.common\x1a\x43google/ads/googleads/v16/enums/customer_match_upload_key_type.proto\x1a>google/ads/googleads/v16/enums/lookalike_expansion_level.proto\x1a\x43google/ads/googleads/v16/enums/user_list_crm_data_source_type.proto\x1a\x46google/ads/googleads/v16/enums/user_list_date_rule_item_operator.proto\x1a\x45google/ads/googleads/v16/enums/user_list_flexible_rule_operator.proto\x1a\x44google/ads/googleads/v16/enums/user_list_logical_rule_operator.proto\x1aHgoogle/ads/googleads/v16/enums/user_list_number_rule_item_operator.proto\x1a\x43google/ads/googleads/v16/enums/user_list_prepopulation_status.proto\x1a\x38google/ads/googleads/v16/enums/user_list_rule_type.proto\x1aHgoogle/ads/googleads/v16/enums/user_list_string_rule_item_operator.proto\"\xb8\x01\n\x15LookalikeUserListInfo\x12\x1a\n\x12seed_user_list_ids\x18\x01 \x03(\x03\x12l\n\x0f\x65xpansion_level\x18\x02 \x01(\x0e\x32S.google.ads.googleads.v16.enums.LookalikeExpansionLevelEnum.LookalikeExpansionLevel\x12\x15\n\rcountry_codes\x18\x03 \x03(\t\"E\n\x13SimilarUserListInfo\x12\x1b\n\x0eseed_user_list\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_seed_user_list\"\x9d\x02\n\x14\x43rmBasedUserListInfo\x12\x13\n\x06\x61pp_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12r\n\x0fupload_key_type\x18\x02 \x01(\x0e\x32Y.google.ads.googleads.v16.enums.CustomerMatchUploadKeyTypeEnum.CustomerMatchUploadKeyType\x12q\n\x10\x64\x61ta_source_type\x18\x03 \x01(\x0e\x32W.google.ads.googleads.v16.enums.UserListCrmDataSourceTypeEnum.UserListCrmDataSourceTypeB\t\n\x07_app_id\"\xc2\x01\n\x10UserListRuleInfo\x12X\n\trule_type\x18\x01 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.UserListRuleTypeEnum.UserListRuleType\x12T\n\x10rule_item_groups\x18\x02 \x03(\x0b\x32:.google.ads.googleads.v16.common.UserListRuleItemGroupInfo\"f\n\x19UserListRuleItemGroupInfo\x12I\n\nrule_items\x18\x01 \x03(\x0b\x32\x35.google.ads.googleads.v16.common.UserListRuleItemInfo\"\xc6\x02\n\x14UserListRuleItemInfo\x12\x11\n\x04name\x18\x05 \x01(\tH\x01\x88\x01\x01\x12W\n\x10number_rule_item\x18\x02 \x01(\x0b\x32;.google.ads.googleads.v16.common.UserListNumberRuleItemInfoH\x00\x12W\n\x10string_rule_item\x18\x03 \x01(\x0b\x32;.google.ads.googleads.v16.common.UserListStringRuleItemInfoH\x00\x12S\n\x0e\x64\x61te_rule_item\x18\x04 \x01(\x0b\x32\x39.google.ads.googleads.v16.common.UserListDateRuleItemInfoH\x00\x42\x0b\n\trule_itemB\x07\n\x05_name\"\xd9\x01\n\x18UserListDateRuleItemInfo\x12o\n\x08operator\x18\x01 \x01(\x0e\x32].google.ads.googleads.v16.enums.UserListDateRuleItemOperatorEnum.UserListDateRuleItemOperator\x12\x12\n\x05value\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x1b\n\x0eoffset_in_days\x18\x05 \x01(\x03H\x01\x88\x01\x01\x42\x08\n\x06_valueB\x11\n\x0f_offset_in_days\"\xaf\x01\n\x1aUserListNumberRuleItemInfo\x12s\n\x08operator\x18\x01 \x01(\x0e\x32\x61.google.ads.googleads.v16.enums.UserListNumberRuleItemOperatorEnum.UserListNumberRuleItemOperator\x12\x12\n\x05value\x18\x03 \x01(\x01H\x00\x88\x01\x01\x42\x08\n\x06_value\"\xaf\x01\n\x1aUserListStringRuleItemInfo\x12s\n\x08operator\x18\x01 \x01(\x0e\x32\x61.google.ads.googleads.v16.enums.UserListStringRuleItemOperatorEnum.UserListStringRuleItemOperator\x12\x12\n\x05value\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"\x96\x01\n\x17\x46lexibleRuleOperandInfo\x12?\n\x04rule\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.UserListRuleInfo\x12!\n\x14lookback_window_days\x18\x02 \x01(\x03H\x00\x88\x01\x01\x42\x17\n\x15_lookback_window_days\"\xc6\x02\n\x18\x46lexibleRuleUserListInfo\x12~\n\x17inclusive_rule_operator\x18\x01 \x01(\x0e\x32].google.ads.googleads.v16.enums.UserListFlexibleRuleOperatorEnum.UserListFlexibleRuleOperator\x12T\n\x12inclusive_operands\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.common.FlexibleRuleOperandInfo\x12T\n\x12\x65xclusive_operands\x18\x03 \x03(\x0b\x32\x38.google.ads.googleads.v16.common.FlexibleRuleOperandInfo\"\xee\x01\n\x15RuleBasedUserListInfo\x12y\n\x14prepopulation_status\x18\x01 \x01(\x0e\x32[.google.ads.googleads.v16.enums.UserListPrepopulationStatusEnum.UserListPrepopulationStatus\x12Z\n\x17\x66lexible_rule_user_list\x18\x05 \x01(\x0b\x32\x39.google.ads.googleads.v16.common.FlexibleRuleUserListInfo\"^\n\x13LogicalUserListInfo\x12G\n\x05rules\x18\x01 \x03(\x0b\x32\x38.google.ads.googleads.v16.common.UserListLogicalRuleInfo\"\xdc\x01\n\x17UserListLogicalRuleInfo\x12m\n\x08operator\x18\x01 \x01(\x0e\x32[.google.ads.googleads.v16.enums.UserListLogicalRuleOperatorEnum.UserListLogicalRuleOperator\x12R\n\rrule_operands\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.common.LogicalUserListOperandInfo\"B\n\x1aLogicalUserListOperandInfo\x12\x16\n\tuser_list\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0c\n\n_user_list\"Y\n\x11\x42\x61sicUserListInfo\x12\x44\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32\x33.google.ads.googleads.v16.common.UserListActionInfo\"c\n\x12UserListActionInfo\x12\x1b\n\x11\x63onversion_action\x18\x03 \x01(\tH\x00\x12\x1c\n\x12remarketing_action\x18\x04 \x01(\tH\x00\x42\x12\n\x10user_list_actionB\xee\x01\n#com.google.ads.googleads.v16.commonB\x0eUserListsProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + LookalikeUserListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LookalikeUserListInfo").msgclass + SimilarUserListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.SimilarUserListInfo").msgclass + CrmBasedUserListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.CrmBasedUserListInfo").msgclass + UserListRuleInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListRuleInfo").msgclass + UserListRuleItemGroupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListRuleItemGroupInfo").msgclass + UserListRuleItemInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListRuleItemInfo").msgclass + UserListDateRuleItemInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListDateRuleItemInfo").msgclass + UserListNumberRuleItemInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListNumberRuleItemInfo").msgclass + UserListStringRuleItemInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListStringRuleItemInfo").msgclass + FlexibleRuleOperandInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.FlexibleRuleOperandInfo").msgclass + FlexibleRuleUserListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.FlexibleRuleUserListInfo").msgclass + RuleBasedUserListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.RuleBasedUserListInfo").msgclass + LogicalUserListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LogicalUserListInfo").msgclass + UserListLogicalRuleInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListLogicalRuleInfo").msgclass + LogicalUserListOperandInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.LogicalUserListOperandInfo").msgclass + BasicUserListInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.BasicUserListInfo").msgclass + UserListActionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.UserListActionInfo").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/common/value_pb.rb b/lib/google/ads/google_ads/v16/common/value_pb.rb new file mode 100644 index 000000000..a29666985 --- /dev/null +++ b/lib/google/ads/google_ads/v16/common/value_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/common/value.proto + +require 'google/protobuf' + + +descriptor_data = "\n+google/ads/googleads/v16/common/value.proto\x12\x1fgoogle.ads.googleads.v16.common\"\x87\x01\n\x05Value\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x15\n\x0bint64_value\x18\x02 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x03 \x01(\x02H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x05 \x01(\tH\x00\x42\x07\n\x05valueB\xea\x01\n#com.google.ads.googleads.v16.commonB\nValueProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/common;common\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Common\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Common\xea\x02#Google::Ads::GoogleAds::V16::Commonb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Common + Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.common.Value").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/access_invitation_status_pb.rb b/lib/google/ads/google_ads/v16/enums/access_invitation_status_pb.rb new file mode 100644 index 000000000..be3978abf --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/access_invitation_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/access_invitation_status.proto + +require 'google/protobuf' + + +descriptor_data = "\n=google/ads/googleads/v16/enums/access_invitation_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"|\n\x1a\x41\x63\x63\x65ssInvitationStatusEnum\"^\n\x16\x41\x63\x63\x65ssInvitationStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x0c\n\x08\x44\x45\x43LINED\x10\x03\x12\x0b\n\x07\x45XPIRED\x10\x04\x42\xf5\x01\n\"com.google.ads.googleads.v16.enumsB\x1b\x41\x63\x63\x65ssInvitationStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AccessInvitationStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccessInvitationStatusEnum").msgclass + AccessInvitationStatusEnum::AccessInvitationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccessInvitationStatusEnum.AccessInvitationStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/access_reason_pb.rb b/lib/google/ads/google_ads/v16/enums/access_reason_pb.rb new file mode 100644 index 000000000..aca8c9d96 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/access_reason_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/access_reason.proto + +require 'google/protobuf' + + +descriptor_data = "\n2google/ads/googleads/v16/enums/access_reason.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x85\x01\n\x10\x41\x63\x63\x65ssReasonEnum\"q\n\x0c\x41\x63\x63\x65ssReason\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\t\n\x05OWNED\x10\x02\x12\n\n\x06SHARED\x10\x03\x12\x0c\n\x08LICENSED\x10\x04\x12\x0e\n\nSUBSCRIBED\x10\x05\x12\x0e\n\nAFFILIATED\x10\x06\x42\xeb\x01\n\"com.google.ads.googleads.v16.enumsB\x11\x41\x63\x63\x65ssReasonProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AccessReasonEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccessReasonEnum").msgclass + AccessReasonEnum::AccessReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccessReasonEnum.AccessReason").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/access_role_pb.rb b/lib/google/ads/google_ads/v16/enums/access_role_pb.rb new file mode 100644 index 000000000..b308f13f9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/access_role_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/access_role.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/ads/googleads/v16/enums/access_role.proto\x12\x1egoogle.ads.googleads.v16.enums\"t\n\x0e\x41\x63\x63\x65ssRoleEnum\"b\n\nAccessRole\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\t\n\x05\x41\x44MIN\x10\x02\x12\x0c\n\x08STANDARD\x10\x03\x12\r\n\tREAD_ONLY\x10\x04\x12\x0e\n\nEMAIL_ONLY\x10\x05\x42\xe9\x01\n\"com.google.ads.googleads.v16.enumsB\x0f\x41\x63\x63\x65ssRoleProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AccessRoleEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccessRoleEnum").msgclass + AccessRoleEnum::AccessRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccessRoleEnum.AccessRole").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/account_budget_proposal_status_pb.rb b/lib/google/ads/google_ads/v16/enums/account_budget_proposal_status_pb.rb new file mode 100644 index 000000000..7c95752e9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/account_budget_proposal_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/account_budget_proposal_status.proto + +require 'google/protobuf' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/enums/account_budget_proposal_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xaa\x01\n\x1f\x41\x63\x63ountBudgetProposalStatusEnum\"\x86\x01\n\x1b\x41\x63\x63ountBudgetProposalStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x11\n\rAPPROVED_HELD\x10\x03\x12\x0c\n\x08\x41PPROVED\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\x0c\n\x08REJECTED\x10\x06\x42\xfa\x01\n\"com.google.ads.googleads.v16.enumsB AccountBudgetProposalStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AccountBudgetProposalStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccountBudgetProposalStatusEnum").msgclass + AccountBudgetProposalStatusEnum::AccountBudgetProposalStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccountBudgetProposalStatusEnum.AccountBudgetProposalStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/account_budget_proposal_type_pb.rb b/lib/google/ads/google_ads/v16/enums/account_budget_proposal_type_pb.rb new file mode 100644 index 000000000..dbd248b07 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/account_budget_proposal_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/account_budget_proposal_type.proto + +require 'google/protobuf' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/enums/account_budget_proposal_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x87\x01\n\x1d\x41\x63\x63ountBudgetProposalTypeEnum\"f\n\x19\x41\x63\x63ountBudgetProposalType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\n\n\x06\x43REATE\x10\x02\x12\n\n\x06UPDATE\x10\x03\x12\x07\n\x03\x45ND\x10\x04\x12\n\n\x06REMOVE\x10\x05\x42\xf8\x01\n\"com.google.ads.googleads.v16.enumsB\x1e\x41\x63\x63ountBudgetProposalTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AccountBudgetProposalTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccountBudgetProposalTypeEnum").msgclass + AccountBudgetProposalTypeEnum::AccountBudgetProposalType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccountBudgetProposalTypeEnum.AccountBudgetProposalType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/account_budget_status_pb.rb b/lib/google/ads/google_ads/v16/enums/account_budget_status_pb.rb new file mode 100644 index 000000000..6be8e3690 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/account_budget_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/account_budget_status.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/ads/googleads/v16/enums/account_budget_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"x\n\x17\x41\x63\x63ountBudgetStatusEnum\"]\n\x13\x41\x63\x63ountBudgetStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x0c\n\x08\x41PPROVED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x42\xf2\x01\n\"com.google.ads.googleads.v16.enumsB\x18\x41\x63\x63ountBudgetStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AccountBudgetStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccountBudgetStatusEnum").msgclass + AccountBudgetStatusEnum::AccountBudgetStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccountBudgetStatusEnum.AccountBudgetStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/account_link_status_pb.rb b/lib/google/ads/google_ads/v16/enums/account_link_status_pb.rb new file mode 100644 index 000000000..619e9154f --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/account_link_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/account_link_status.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/ads/googleads/v16/enums/account_link_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xa5\x01\n\x15\x41\x63\x63ountLinkStatusEnum\"\x8b\x01\n\x11\x41\x63\x63ountLinkStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x0b\n\x07REMOVED\x10\x03\x12\r\n\tREQUESTED\x10\x04\x12\x14\n\x10PENDING_APPROVAL\x10\x05\x12\x0c\n\x08REJECTED\x10\x06\x12\x0b\n\x07REVOKED\x10\x07\x42\xf0\x01\n\"com.google.ads.googleads.v16.enumsB\x16\x41\x63\x63ountLinkStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AccountLinkStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccountLinkStatusEnum").msgclass + AccountLinkStatusEnum::AccountLinkStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AccountLinkStatusEnum.AccountLinkStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_customizer_placeholder_field_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_customizer_placeholder_field_pb.rb new file mode 100644 index 000000000..af326552b --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_customizer_placeholder_field_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_customizer_placeholder_field.proto + +require 'google/protobuf' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/enums/ad_customizer_placeholder_field.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x8e\x01\n AdCustomizerPlaceholderFieldEnum\"j\n\x1c\x41\x64\x43ustomizerPlaceholderField\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07INTEGER\x10\x02\x12\t\n\x05PRICE\x10\x03\x12\x08\n\x04\x44\x41TE\x10\x04\x12\n\n\x06STRING\x10\x05\x42\xfb\x01\n\"com.google.ads.googleads.v16.enumsB!AdCustomizerPlaceholderFieldProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AdCustomizerPlaceholderFieldEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdCustomizerPlaceholderFieldEnum").msgclass + AdCustomizerPlaceholderFieldEnum::AdCustomizerPlaceholderField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdCustomizerPlaceholderFieldEnum.AdCustomizerPlaceholderField").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_destination_type_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_destination_type_pb.rb new file mode 100644 index 000000000..cd60718e8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_destination_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_destination_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/ads/googleads/v16/enums/ad_destination_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x90\x02\n\x15\x41\x64\x44\x65stinationTypeEnum\"\xf6\x01\n\x11\x41\x64\x44\x65stinationType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x12\n\x0eNOT_APPLICABLE\x10\x02\x12\x0b\n\x07WEBSITE\x10\x03\x12\x11\n\rAPP_DEEP_LINK\x10\x04\x12\r\n\tAPP_STORE\x10\x05\x12\x0e\n\nPHONE_CALL\x10\x06\x12\x12\n\x0eMAP_DIRECTIONS\x10\x07\x12\x14\n\x10LOCATION_LISTING\x10\x08\x12\x0b\n\x07MESSAGE\x10\t\x12\r\n\tLEAD_FORM\x10\n\x12\x0b\n\x07YOUTUBE\x10\x0b\x12\x1d\n\x19UNMODELED_FOR_CONVERSIONS\x10\x0c\x42\xf0\x01\n\"com.google.ads.googleads.v16.enumsB\x16\x41\x64\x44\x65stinationTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AdDestinationTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdDestinationTypeEnum").msgclass + AdDestinationTypeEnum::AdDestinationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdDestinationTypeEnum.AdDestinationType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_group_ad_primary_status_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_group_ad_primary_status_pb.rb new file mode 100644 index 000000000..5d5e17ff8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_group_ad_primary_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_group_ad_primary_status.proto + +require 'google/protobuf' + + +descriptor_data = "\n?google/ads/googleads/v16/enums/ad_group_ad_primary_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xa8\x01\n\x1a\x41\x64GroupAdPrimaryStatusEnum\"\x89\x01\n\x16\x41\x64GroupAdPrimaryStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08\x45LIGIBLE\x10\x02\x12\n\n\x06PAUSED\x10\x03\x12\x0b\n\x07REMOVED\x10\x04\x12\x0b\n\x07PENDING\x10\x05\x12\x0b\n\x07LIMITED\x10\x06\x12\x10\n\x0cNOT_ELIGIBLE\x10\x07\x42\xf5\x01\n\"com.google.ads.googleads.v16.enumsB\x1b\x41\x64GroupAdPrimaryStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AdGroupAdPrimaryStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupAdPrimaryStatusEnum").msgclass + AdGroupAdPrimaryStatusEnum::AdGroupAdPrimaryStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupAdPrimaryStatusEnum.AdGroupAdPrimaryStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_group_ad_primary_status_reason_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_group_ad_primary_status_reason_pb.rb new file mode 100644 index 000000000..e79ab948b --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_group_ad_primary_status_reason_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_group_ad_primary_status_reason.proto + +require 'google/protobuf' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/enums/ad_group_ad_primary_status_reason.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xea\x03\n AdGroupAdPrimaryStatusReasonEnum\"\xc5\x03\n\x1c\x41\x64GroupAdPrimaryStatusReason\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x14\n\x10\x43\x41MPAIGN_REMOVED\x10\x02\x12\x13\n\x0f\x43\x41MPAIGN_PAUSED\x10\x03\x12\x14\n\x10\x43\x41MPAIGN_PENDING\x10\x04\x12\x12\n\x0e\x43\x41MPAIGN_ENDED\x10\x05\x12\x13\n\x0f\x41\x44_GROUP_PAUSED\x10\x06\x12\x14\n\x10\x41\x44_GROUP_REMOVED\x10\x07\x12\x16\n\x12\x41\x44_GROUP_AD_PAUSED\x10\x08\x12\x17\n\x13\x41\x44_GROUP_AD_REMOVED\x10\t\x12\x1b\n\x17\x41\x44_GROUP_AD_DISAPPROVED\x10\n\x12\x1c\n\x18\x41\x44_GROUP_AD_UNDER_REVIEW\x10\x0b\x12\x1c\n\x18\x41\x44_GROUP_AD_POOR_QUALITY\x10\x0c\x12\x16\n\x12\x41\x44_GROUP_AD_NO_ADS\x10\r\x12 \n\x1c\x41\x44_GROUP_AD_APPROVED_LABELED\x10\x0e\x12%\n!AD_GROUP_AD_AREA_OF_INTEREST_ONLY\x10\x0f\x12\x1c\n\x18\x41\x44_GROUP_AD_UNDER_APPEAL\x10\x10\x42\xfb\x01\n\"com.google.ads.googleads.v16.enumsB!AdGroupAdPrimaryStatusReasonProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AdGroupAdPrimaryStatusReasonEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupAdPrimaryStatusReasonEnum").msgclass + AdGroupAdPrimaryStatusReasonEnum::AdGroupAdPrimaryStatusReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupAdPrimaryStatusReasonEnum.AdGroupAdPrimaryStatusReason").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_group_ad_rotation_mode_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_group_ad_rotation_mode_pb.rb new file mode 100644 index 000000000..837dcd1d3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_group_ad_rotation_mode_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_group_ad_rotation_mode.proto + +require 'google/protobuf' + + +descriptor_data = "\n>google/ads/googleads/v16/enums/ad_group_ad_rotation_mode.proto\x12\x1egoogle.ads.googleads.v16.enums\"t\n\x19\x41\x64GroupAdRotationModeEnum\"W\n\x15\x41\x64GroupAdRotationMode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08OPTIMIZE\x10\x02\x12\x12\n\x0eROTATE_FOREVER\x10\x03\x42\xf4\x01\n\"com.google.ads.googleads.v16.enumsB\x1a\x41\x64GroupAdRotationModeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AdGroupAdRotationModeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupAdRotationModeEnum").msgclass + AdGroupAdRotationModeEnum::AdGroupAdRotationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupAdRotationModeEnum.AdGroupAdRotationMode").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_group_ad_status_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_group_ad_status_pb.rb new file mode 100644 index 000000000..c096b3897 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_group_ad_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_group_ad_status.proto + +require 'google/protobuf' + + +descriptor_data = "\n7google/ads/googleads/v16/enums/ad_group_ad_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"l\n\x13\x41\x64GroupAdStatusEnum\"U\n\x0f\x41\x64GroupAdStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\n\n\x06PAUSED\x10\x03\x12\x0b\n\x07REMOVED\x10\x04\x42\xee\x01\n\"com.google.ads.googleads.v16.enumsB\x14\x41\x64GroupAdStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AdGroupAdStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupAdStatusEnum").msgclass + AdGroupAdStatusEnum::AdGroupAdStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupAdStatusEnum.AdGroupAdStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_group_criterion_approval_status_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_group_criterion_approval_status_pb.rb new file mode 100644 index 000000000..f726ae952 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_group_criterion_approval_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_group_criterion_approval_status.proto + +require 'google/protobuf' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/enums/ad_group_criterion_approval_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xaa\x01\n\"AdGroupCriterionApprovalStatusEnum\"\x83\x01\n\x1e\x41\x64GroupCriterionApprovalStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08\x41PPROVED\x10\x02\x12\x0f\n\x0b\x44ISAPPROVED\x10\x03\x12\x12\n\x0ePENDING_REVIEW\x10\x04\x12\x10\n\x0cUNDER_REVIEW\x10\x05\x42\xfd\x01\n\"com.google.ads.googleads.v16.enumsB#AdGroupCriterionApprovalStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AdGroupCriterionApprovalStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupCriterionApprovalStatusEnum").msgclass + AdGroupCriterionApprovalStatusEnum::AdGroupCriterionApprovalStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupCriterionApprovalStatusEnum.AdGroupCriterionApprovalStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_group_criterion_status_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_group_criterion_status_pb.rb new file mode 100644 index 000000000..fbf5f6b71 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_group_criterion_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_group_criterion_status.proto + +require 'google/protobuf' + + +descriptor_data = "\n>google/ads/googleads/v16/enums/ad_group_criterion_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"z\n\x1a\x41\x64GroupCriterionStatusEnum\"\\\n\x16\x41\x64GroupCriterionStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\n\n\x06PAUSED\x10\x03\x12\x0b\n\x07REMOVED\x10\x04\x42\xf5\x01\n\"com.google.ads.googleads.v16.enumsB\x1b\x41\x64GroupCriterionStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + AdGroupCriterionStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupCriterionStatusEnum").msgclass + AdGroupCriterionStatusEnum::AdGroupCriterionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.AdGroupCriterionStatusEnum.AdGroupCriterionStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/ad_group_primary_status_pb.rb b/lib/google/ads/google_ads/v16/enums/ad_group_primary_status_pb.rb new file mode 100644 index 000000000..110da90b1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/ad_group_primary_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/ad_group_primary_status.proto + +require 'google/protobuf' + + +descriptor_data = "\nB\xee\x01\n\"com.google.ads.googleads.v16.enumsB\x14InteractionTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + InteractionTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.InteractionTypeEnum").msgclass + InteractionTypeEnum::InteractionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.InteractionTypeEnum.InteractionType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/invoice_type_pb.rb b/lib/google/ads/google_ads/v16/enums/invoice_type_pb.rb new file mode 100644 index 000000000..f2d24624c --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/invoice_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/invoice_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/ads/googleads/v16/enums/invoice_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\\\n\x0fInvoiceTypeEnum\"I\n\x0bInvoiceType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0f\n\x0b\x43REDIT_MEMO\x10\x02\x12\x0b\n\x07INVOICE\x10\x03\x42\xea\x01\n\"com.google.ads.googleads.v16.enumsB\x10InvoiceTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + InvoiceTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.InvoiceTypeEnum").msgclass + InvoiceTypeEnum::InvoiceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.InvoiceTypeEnum.InvoiceType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/job_placeholder_field_pb.rb b/lib/google/ads/google_ads/v16/enums/job_placeholder_field_pb.rb new file mode 100644 index 000000000..ec724a079 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/job_placeholder_field_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/job_placeholder_field.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/ads/googleads/v16/enums/job_placeholder_field.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xf1\x02\n\x17JobPlaceholderFieldEnum\"\xd5\x02\n\x13JobPlaceholderField\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\n\n\x06JOB_ID\x10\x02\x12\x0f\n\x0bLOCATION_ID\x10\x03\x12\t\n\x05TITLE\x10\x04\x12\x0c\n\x08SUBTITLE\x10\x05\x12\x0f\n\x0b\x44\x45SCRIPTION\x10\x06\x12\r\n\tIMAGE_URL\x10\x07\x12\x0c\n\x08\x43\x41TEGORY\x10\x08\x12\x17\n\x13\x43ONTEXTUAL_KEYWORDS\x10\t\x12\x0b\n\x07\x41\x44\x44RESS\x10\n\x12\n\n\x06SALARY\x10\x0b\x12\x0e\n\nFINAL_URLS\x10\x0c\x12\x15\n\x11\x46INAL_MOBILE_URLS\x10\x0e\x12\x10\n\x0cTRACKING_URL\x10\x0f\x12\x14\n\x10\x41NDROID_APP_LINK\x10\x10\x12\x13\n\x0fSIMILAR_JOB_IDS\x10\x11\x12\x10\n\x0cIOS_APP_LINK\x10\x12\x12\x14\n\x10IOS_APP_STORE_ID\x10\x13\x42\xf3\x01\n\"com.google.ads.googleads.v16.enumsB\x19JobsPlaceholderFieldProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + JobPlaceholderFieldEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.JobPlaceholderFieldEnum").msgclass + JobPlaceholderFieldEnum::JobPlaceholderField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.JobPlaceholderFieldEnum.JobPlaceholderField").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/keyword_match_type_pb.rb b/lib/google/ads/google_ads/v16/enums/keyword_match_type_pb.rb new file mode 100644 index 000000000..9561686e4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/keyword_match_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/keyword_match_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n7google/ads/googleads/v16/enums/keyword_match_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"j\n\x14KeywordMatchTypeEnum\"R\n\x10KeywordMatchType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\t\n\x05\x45XACT\x10\x02\x12\n\n\x06PHRASE\x10\x03\x12\t\n\x05\x42ROAD\x10\x04\x42\xef\x01\n\"com.google.ads.googleads.v16.enumsB\x15KeywordMatchTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + KeywordMatchTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordMatchTypeEnum").msgclass + KeywordMatchTypeEnum::KeywordMatchType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordMatchTypeEnum.KeywordMatchType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/keyword_plan_aggregate_metric_type_pb.rb b/lib/google/ads/google_ads/v16/enums/keyword_plan_aggregate_metric_type_pb.rb new file mode 100644 index 000000000..92d6bfc31 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/keyword_plan_aggregate_metric_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/keyword_plan_aggregate_metric_type.proto + +require 'google/protobuf' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/enums/keyword_plan_aggregate_metric_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"p\n\"KeywordPlanAggregateMetricTypeEnum\"J\n\x1eKeywordPlanAggregateMetricType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\n\n\x06\x44\x45VICE\x10\x02\x42\xfd\x01\n\"com.google.ads.googleads.v16.enumsB#KeywordPlanAggregateMetricTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + KeywordPlanAggregateMetricTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanAggregateMetricTypeEnum").msgclass + KeywordPlanAggregateMetricTypeEnum::KeywordPlanAggregateMetricType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanAggregateMetricTypeEnum.KeywordPlanAggregateMetricType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/keyword_plan_competition_level_pb.rb b/lib/google/ads/google_ads/v16/enums/keyword_plan_competition_level_pb.rb new file mode 100644 index 000000000..c1fa95a80 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/keyword_plan_competition_level_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/keyword_plan_competition_level.proto + +require 'google/protobuf' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/enums/keyword_plan_competition_level.proto\x12\x1egoogle.ads.googleads.v16.enums\"}\n\x1fKeywordPlanCompetitionLevelEnum\"Z\n\x1bKeywordPlanCompetitionLevel\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\x42\xfa\x01\n\"com.google.ads.googleads.v16.enumsB KeywordPlanCompetitionLevelProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + KeywordPlanCompetitionLevelEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanCompetitionLevelEnum").msgclass + KeywordPlanCompetitionLevelEnum::KeywordPlanCompetitionLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanCompetitionLevelEnum.KeywordPlanCompetitionLevel").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/keyword_plan_concept_group_type_pb.rb b/lib/google/ads/google_ads/v16/enums/keyword_plan_concept_group_type_pb.rb new file mode 100644 index 000000000..17369927c --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/keyword_plan_concept_group_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/keyword_plan_concept_group_type.proto + +require 'google/protobuf' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/enums/keyword_plan_concept_group_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x8a\x01\n\x1fKeywordPlanConceptGroupTypeEnum\"g\n\x1bKeywordPlanConceptGroupType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\t\n\x05\x42RAND\x10\x02\x12\x10\n\x0cOTHER_BRANDS\x10\x03\x12\r\n\tNON_BRAND\x10\x04\x42\xfa\x01\n\"com.google.ads.googleads.v16.enumsB KeywordPlanConceptGroupTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + KeywordPlanConceptGroupTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanConceptGroupTypeEnum").msgclass + KeywordPlanConceptGroupTypeEnum::KeywordPlanConceptGroupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanConceptGroupTypeEnum.KeywordPlanConceptGroupType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/keyword_plan_forecast_interval_pb.rb b/lib/google/ads/google_ads/v16/enums/keyword_plan_forecast_interval_pb.rb new file mode 100644 index 000000000..86c90d350 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/keyword_plan_forecast_interval_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/keyword_plan_forecast_interval.proto + +require 'google/protobuf' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/enums/keyword_plan_forecast_interval.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x8f\x01\n\x1fKeywordPlanForecastIntervalEnum\"l\n\x1bKeywordPlanForecastInterval\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\r\n\tNEXT_WEEK\x10\x03\x12\x0e\n\nNEXT_MONTH\x10\x04\x12\x10\n\x0cNEXT_QUARTER\x10\x05\x42\xfa\x01\n\"com.google.ads.googleads.v16.enumsB KeywordPlanForecastIntervalProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + KeywordPlanForecastIntervalEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanForecastIntervalEnum").msgclass + KeywordPlanForecastIntervalEnum::KeywordPlanForecastInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanForecastIntervalEnum.KeywordPlanForecastInterval").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/keyword_plan_keyword_annotation_pb.rb b/lib/google/ads/google_ads/v16/enums/keyword_plan_keyword_annotation_pb.rb new file mode 100644 index 000000000..4de727cbb --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/keyword_plan_keyword_annotation_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/keyword_plan_keyword_annotation.proto + +require 'google/protobuf' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/enums/keyword_plan_keyword_annotation.proto\x12\x1egoogle.ads.googleads.v16.enums\"u\n KeywordPlanKeywordAnnotationEnum\"Q\n\x1cKeywordPlanKeywordAnnotation\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x13\n\x0fKEYWORD_CONCEPT\x10\x02\x42\xfb\x01\n\"com.google.ads.googleads.v16.enumsB!KeywordPlanKeywordAnnotationProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + KeywordPlanKeywordAnnotationEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanKeywordAnnotationEnum").msgclass + KeywordPlanKeywordAnnotationEnum::KeywordPlanKeywordAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanKeywordAnnotationEnum.KeywordPlanKeywordAnnotation").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/keyword_plan_network_pb.rb b/lib/google/ads/google_ads/v16/enums/keyword_plan_network_pb.rb new file mode 100644 index 000000000..5856a8bac --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/keyword_plan_network_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/keyword_plan_network.proto + +require 'google/protobuf' + + +descriptor_data = "\n9google/ads/googleads/v16/enums/keyword_plan_network.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x7f\n\x16KeywordPlanNetworkEnum\"e\n\x12KeywordPlanNetwork\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x11\n\rGOOGLE_SEARCH\x10\x02\x12\x1e\n\x1aGOOGLE_SEARCH_AND_PARTNERS\x10\x03\x42\xf1\x01\n\"com.google.ads.googleads.v16.enumsB\x17KeywordPlanNetworkProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + KeywordPlanNetworkEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanNetworkEnum").msgclass + KeywordPlanNetworkEnum::KeywordPlanNetwork = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.KeywordPlanNetworkEnum.KeywordPlanNetwork").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/label_status_pb.rb b/lib/google/ads/google_ads/v16/enums/label_status_pb.rb new file mode 100644 index 000000000..1eebc5ef8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/label_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/label_status.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/ads/googleads/v16/enums/label_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"X\n\x0fLabelStatusEnum\"E\n\x0bLabelStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x0b\n\x07REMOVED\x10\x03\x42\xea\x01\n\"com.google.ads.googleads.v16.enumsB\x10LabelStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + LabelStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LabelStatusEnum").msgclass + LabelStatusEnum::LabelStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LabelStatusEnum.LabelStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/lead_form_call_to_action_type_pb.rb b/lib/google/ads/google_ads/v16/enums/lead_form_call_to_action_type_pb.rb new file mode 100644 index 000000000..1943e926d --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/lead_form_call_to_action_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/lead_form_call_to_action_type.proto + +require 'google/protobuf' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/enums/lead_form_call_to_action_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xab\x02\n\x1cLeadFormCallToActionTypeEnum\"\x8a\x02\n\x18LeadFormCallToActionType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0e\n\nLEARN_MORE\x10\x02\x12\r\n\tGET_QUOTE\x10\x03\x12\r\n\tAPPLY_NOW\x10\x04\x12\x0b\n\x07SIGN_UP\x10\x05\x12\x0e\n\nCONTACT_US\x10\x06\x12\r\n\tSUBSCRIBE\x10\x07\x12\x0c\n\x08\x44OWNLOAD\x10\x08\x12\x0c\n\x08\x42OOK_NOW\x10\t\x12\r\n\tGET_OFFER\x10\n\x12\x0c\n\x08REGISTER\x10\x0b\x12\x0c\n\x08GET_INFO\x10\x0c\x12\x10\n\x0cREQUEST_DEMO\x10\r\x12\x0c\n\x08JOIN_NOW\x10\x0e\x12\x0f\n\x0bGET_STARTED\x10\x0f\x42\xf7\x01\n\"com.google.ads.googleads.v16.enumsB\x1dLeadFormCallToActionTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + LeadFormCallToActionTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LeadFormCallToActionTypeEnum").msgclass + LeadFormCallToActionTypeEnum::LeadFormCallToActionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LeadFormCallToActionTypeEnum.LeadFormCallToActionType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/lead_form_desired_intent_pb.rb b/lib/google/ads/google_ads/v16/enums/lead_form_desired_intent_pb.rb new file mode 100644 index 000000000..48c3acce0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/lead_form_desired_intent_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/lead_form_desired_intent.proto + +require 'google/protobuf' + + +descriptor_data = "\n=google/ads/googleads/v16/enums/lead_form_desired_intent.proto\x12\x1egoogle.ads.googleads.v16.enums\"s\n\x19LeadFormDesiredIntentEnum\"V\n\x15LeadFormDesiredIntent\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0e\n\nLOW_INTENT\x10\x02\x12\x0f\n\x0bHIGH_INTENT\x10\x03\x42\xf4\x01\n\"com.google.ads.googleads.v16.enumsB\x1aLeadFormDesiredIntentProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + LeadFormDesiredIntentEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LeadFormDesiredIntentEnum").msgclass + LeadFormDesiredIntentEnum::LeadFormDesiredIntent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LeadFormDesiredIntentEnum.LeadFormDesiredIntent").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/lead_form_field_user_input_type_pb.rb b/lib/google/ads/google_ads/v16/enums/lead_form_field_user_input_type_pb.rb new file mode 100644 index 000000000..6476ae14a --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/lead_form_field_user_input_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/lead_form_field_user_input_type.proto + +require 'google/protobuf' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/enums/lead_form_field_user_input_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xc8\x13\n\x1eLeadFormFieldUserInputTypeEnum\"\xa5\x13\n\x1aLeadFormFieldUserInputType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\r\n\tFULL_NAME\x10\x02\x12\t\n\x05\x45MAIL\x10\x03\x12\x10\n\x0cPHONE_NUMBER\x10\x04\x12\x0f\n\x0bPOSTAL_CODE\x10\x05\x12\x12\n\x0eSTREET_ADDRESS\x10\x08\x12\x08\n\x04\x43ITY\x10\t\x12\n\n\x06REGION\x10\n\x12\x0b\n\x07\x43OUNTRY\x10\x0b\x12\x0e\n\nWORK_EMAIL\x10\x0c\x12\x10\n\x0c\x43OMPANY_NAME\x10\r\x12\x0e\n\nWORK_PHONE\x10\x0e\x12\r\n\tJOB_TITLE\x10\x0f\x12\x1f\n\x1bGOVERNMENT_ISSUED_ID_CPF_BR\x10\x10\x12\x1f\n\x1bGOVERNMENT_ISSUED_ID_DNI_AR\x10\x11\x12\x1f\n\x1bGOVERNMENT_ISSUED_ID_DNI_PE\x10\x12\x12\x1f\n\x1bGOVERNMENT_ISSUED_ID_RUT_CL\x10\x13\x12\x1e\n\x1aGOVERNMENT_ISSUED_ID_CC_CO\x10\x14\x12\x1e\n\x1aGOVERNMENT_ISSUED_ID_CI_EC\x10\x15\x12\x1f\n\x1bGOVERNMENT_ISSUED_ID_RFC_MX\x10\x16\x12\x0e\n\nFIRST_NAME\x10\x17\x12\r\n\tLAST_NAME\x10\x18\x12\x12\n\rVEHICLE_MODEL\x10\xe9\x07\x12\x11\n\x0cVEHICLE_TYPE\x10\xea\x07\x12\x19\n\x14PREFERRED_DEALERSHIP\x10\xeb\x07\x12\x1e\n\x19VEHICLE_PURCHASE_TIMELINE\x10\xec\x07\x12\x16\n\x11VEHICLE_OWNERSHIP\x10\xed\x07\x12\x19\n\x14VEHICLE_PAYMENT_TYPE\x10\xf1\x07\x12\x16\n\x11VEHICLE_CONDITION\x10\xf2\x07\x12\x11\n\x0c\x43OMPANY_SIZE\x10\xee\x07\x12\x11\n\x0c\x41NNUAL_SALES\x10\xef\x07\x12\x16\n\x11YEARS_IN_BUSINESS\x10\xf0\x07\x12\x13\n\x0eJOB_DEPARTMENT\x10\xf3\x07\x12\r\n\x08JOB_ROLE\x10\xf4\x07\x12\x10\n\x0bOVER_18_AGE\x10\xb6\x08\x12\x10\n\x0bOVER_19_AGE\x10\xb7\x08\x12\x10\n\x0bOVER_20_AGE\x10\xb8\x08\x12\x10\n\x0bOVER_21_AGE\x10\xb9\x08\x12\x10\n\x0bOVER_22_AGE\x10\xba\x08\x12\x10\n\x0bOVER_23_AGE\x10\xbb\x08\x12\x10\n\x0bOVER_24_AGE\x10\xbc\x08\x12\x10\n\x0bOVER_25_AGE\x10\xbd\x08\x12\x10\n\x0bOVER_26_AGE\x10\xbe\x08\x12\x10\n\x0bOVER_27_AGE\x10\xbf\x08\x12\x10\n\x0bOVER_28_AGE\x10\xc0\x08\x12\x10\n\x0bOVER_29_AGE\x10\xc1\x08\x12\x10\n\x0bOVER_30_AGE\x10\xc2\x08\x12\x10\n\x0bOVER_31_AGE\x10\xc3\x08\x12\x10\n\x0bOVER_32_AGE\x10\xc4\x08\x12\x10\n\x0bOVER_33_AGE\x10\xc5\x08\x12\x10\n\x0bOVER_34_AGE\x10\xc6\x08\x12\x10\n\x0bOVER_35_AGE\x10\xc7\x08\x12\x10\n\x0bOVER_36_AGE\x10\xc8\x08\x12\x10\n\x0bOVER_37_AGE\x10\xc9\x08\x12\x10\n\x0bOVER_38_AGE\x10\xca\x08\x12\x10\n\x0bOVER_39_AGE\x10\xcb\x08\x12\x10\n\x0bOVER_40_AGE\x10\xcc\x08\x12\x10\n\x0bOVER_41_AGE\x10\xcd\x08\x12\x10\n\x0bOVER_42_AGE\x10\xce\x08\x12\x10\n\x0bOVER_43_AGE\x10\xcf\x08\x12\x10\n\x0bOVER_44_AGE\x10\xd0\x08\x12\x10\n\x0bOVER_45_AGE\x10\xd1\x08\x12\x10\n\x0bOVER_46_AGE\x10\xd2\x08\x12\x10\n\x0bOVER_47_AGE\x10\xd3\x08\x12\x10\n\x0bOVER_48_AGE\x10\xd4\x08\x12\x10\n\x0bOVER_49_AGE\x10\xd5\x08\x12\x10\n\x0bOVER_50_AGE\x10\xd6\x08\x12\x10\n\x0bOVER_51_AGE\x10\xd7\x08\x12\x10\n\x0bOVER_52_AGE\x10\xd8\x08\x12\x10\n\x0bOVER_53_AGE\x10\xd9\x08\x12\x10\n\x0bOVER_54_AGE\x10\xda\x08\x12\x10\n\x0bOVER_55_AGE\x10\xdb\x08\x12\x10\n\x0bOVER_56_AGE\x10\xdc\x08\x12\x10\n\x0bOVER_57_AGE\x10\xdd\x08\x12\x10\n\x0bOVER_58_AGE\x10\xde\x08\x12\x10\n\x0bOVER_59_AGE\x10\xdf\x08\x12\x10\n\x0bOVER_60_AGE\x10\xe0\x08\x12\x10\n\x0bOVER_61_AGE\x10\xe1\x08\x12\x10\n\x0bOVER_62_AGE\x10\xe2\x08\x12\x10\n\x0bOVER_63_AGE\x10\xe3\x08\x12\x10\n\x0bOVER_64_AGE\x10\xe4\x08\x12\x10\n\x0bOVER_65_AGE\x10\xe5\x08\x12\x16\n\x11\x45\x44UCATION_PROGRAM\x10\xf5\x07\x12\x15\n\x10\x45\x44UCATION_COURSE\x10\xf6\x07\x12\x0c\n\x07PRODUCT\x10\xf8\x07\x12\x0c\n\x07SERVICE\x10\xf9\x07\x12\n\n\x05OFFER\x10\xfa\x07\x12\r\n\x08\x43\x41TEGORY\x10\xfb\x07\x12\x1d\n\x18PREFERRED_CONTACT_METHOD\x10\xfc\x07\x12\x17\n\x12PREFERRED_LOCATION\x10\xfd\x07\x12\x1b\n\x16PREFERRED_CONTACT_TIME\x10\xfe\x07\x12\x16\n\x11PURCHASE_TIMELINE\x10\xff\x07\x12\x18\n\x13YEARS_OF_EXPERIENCE\x10\x98\x08\x12\x11\n\x0cJOB_INDUSTRY\x10\x99\x08\x12\x17\n\x12LEVEL_OF_EDUCATION\x10\x9a\x08\x12\x12\n\rPROPERTY_TYPE\x10\x80\x08\x12\x16\n\x11REALTOR_HELP_GOAL\x10\x81\x08\x12\x17\n\x12PROPERTY_COMMUNITY\x10\x82\x08\x12\x10\n\x0bPRICE_RANGE\x10\x83\x08\x12\x17\n\x12NUMBER_OF_BEDROOMS\x10\x84\x08\x12\x17\n\x12\x46URNISHED_PROPERTY\x10\x85\x08\x12\x1a\n\x15PETS_ALLOWED_PROPERTY\x10\x86\x08\x12\x1a\n\x15NEXT_PLANNED_PURCHASE\x10\x87\x08\x12\x1a\n\x15\x45VENT_SIGNUP_INTEREST\x10\x89\x08\x12\x1e\n\x19PREFERRED_SHOPPING_PLACES\x10\x8a\x08\x12\x13\n\x0e\x46\x41VORITE_BRAND\x10\x8b\x08\x12+\n&TRANSPORTATION_COMMERCIAL_LICENSE_TYPE\x10\x8c\x08\x12\x1b\n\x16\x45VENT_BOOKING_INTEREST\x10\x8e\x08\x12\x18\n\x13\x44\x45STINATION_COUNTRY\x10\x8f\x08\x12\x15\n\x10\x44\x45STINATION_CITY\x10\x90\x08\x12\x16\n\x11\x44\x45PARTURE_COUNTRY\x10\x91\x08\x12\x13\n\x0e\x44\x45PARTURE_CITY\x10\x92\x08\x12\x13\n\x0e\x44\x45PARTURE_DATE\x10\x93\x08\x12\x10\n\x0bRETURN_DATE\x10\x94\x08\x12\x18\n\x13NUMBER_OF_TRAVELERS\x10\x95\x08\x12\x12\n\rTRAVEL_BUDGET\x10\x96\x08\x12\x19\n\x14TRAVEL_ACCOMMODATION\x10\x97\x08\x42\xf9\x01\n\"com.google.ads.googleads.v16.enumsB\x1fLeadFormFieldUserInputTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + LeadFormFieldUserInputTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LeadFormFieldUserInputTypeEnum").msgclass + LeadFormFieldUserInputTypeEnum::LeadFormFieldUserInputType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LeadFormFieldUserInputTypeEnum.LeadFormFieldUserInputType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/lead_form_post_submit_call_to_action_type_pb.rb b/lib/google/ads/google_ads/v16/enums/lead_form_post_submit_call_to_action_type_pb.rb new file mode 100644 index 000000000..a53bb8094 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/lead_form_post_submit_call_to_action_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/lead_form_post_submit_call_to_action_type.proto + +require 'google/protobuf' + + +descriptor_data = "\nNgoogle/ads/googleads/v16/enums/lead_form_post_submit_call_to_action_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xa8\x01\n&LeadFormPostSubmitCallToActionTypeEnum\"~\n\"LeadFormPostSubmitCallToActionType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0e\n\nVISIT_SITE\x10\x02\x12\x0c\n\x08\x44OWNLOAD\x10\x03\x12\x0e\n\nLEARN_MORE\x10\x04\x12\x0c\n\x08SHOP_NOW\x10\x05\x42\x81\x02\n\"com.google.ads.googleads.v16.enumsB\'LeadFormPostSubmitCallToActionTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + LeadFormPostSubmitCallToActionTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LeadFormPostSubmitCallToActionTypeEnum").msgclass + LeadFormPostSubmitCallToActionTypeEnum::LeadFormPostSubmitCallToActionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LeadFormPostSubmitCallToActionTypeEnum.LeadFormPostSubmitCallToActionType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/legacy_app_install_ad_app_store_pb.rb b/lib/google/ads/google_ads/v16/enums/legacy_app_install_ad_app_store_pb.rb new file mode 100644 index 000000000..b72d7d399 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/legacy_app_install_ad_app_store_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/legacy_app_install_ad_app_store.proto + +require 'google/protobuf' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/enums/legacy_app_install_ad_app_store.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xc1\x01\n\x1eLegacyAppInstallAdAppStoreEnum\"\x9e\x01\n\x1aLegacyAppInstallAdAppStore\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x13\n\x0f\x41PPLE_APP_STORE\x10\x02\x12\x0f\n\x0bGOOGLE_PLAY\x10\x03\x12\x11\n\rWINDOWS_STORE\x10\x04\x12\x17\n\x13WINDOWS_PHONE_STORE\x10\x05\x12\x10\n\x0c\x43N_APP_STORE\x10\x06\x42\xf9\x01\n\"com.google.ads.googleads.v16.enumsB\x1fLegacyAppInstallAdAppStoreProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + LegacyAppInstallAdAppStoreEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LegacyAppInstallAdAppStoreEnum").msgclass + LegacyAppInstallAdAppStoreEnum::LegacyAppInstallAdAppStore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LegacyAppInstallAdAppStoreEnum.LegacyAppInstallAdAppStore").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/linked_account_type_pb.rb b/lib/google/ads/google_ads/v16/enums/linked_account_type_pb.rb new file mode 100644 index 000000000..dc5d3771c --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/linked_account_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/linked_account_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/ads/googleads/v16/enums/linked_account_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"i\n\x15LinkedAccountTypeEnum\"P\n\x11LinkedAccountType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1d\n\x19THIRD_PARTY_APP_ANALYTICS\x10\x02\x42\xf0\x01\n\"com.google.ads.googleads.v16.enumsB\x16LinkedAccountTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + LinkedAccountTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LinkedAccountTypeEnum").msgclass + LinkedAccountTypeEnum::LinkedAccountType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LinkedAccountTypeEnum.LinkedAccountType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/linked_product_type_pb.rb b/lib/google/ads/google_ads/v16/enums/linked_product_type_pb.rb new file mode 100644 index 000000000..84bdb18be --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/linked_product_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/linked_product_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/ads/googleads/v16/enums/linked_product_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xad\x01\n\x15LinkedProductTypeEnum\"\x93\x01\n\x11LinkedProductType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x10\n\x0c\x44\x41TA_PARTNER\x10\x02\x12\x0e\n\nGOOGLE_ADS\x10\x03\x12\x10\n\x0cHOTEL_CENTER\x10\x07\x12\x13\n\x0fMERCHANT_CENTER\x10\x08\x12\x17\n\x13\x41\x44VERTISING_PARTNER\x10\tB\xf0\x01\n\"com.google.ads.googleads.v16.enumsB\x16LinkedProductTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + LinkedProductTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LinkedProductTypeEnum").msgclass + LinkedProductTypeEnum::LinkedProductType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.LinkedProductTypeEnum.LinkedProductType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_group_filter_custom_attribute_index_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_group_filter_custom_attribute_index_pb.rb new file mode 100644 index 000000000..92857a4db --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_group_filter_custom_attribute_index_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_group_filter_custom_attribute_index.proto + +require 'google/protobuf' + + +descriptor_data = "\nPgoogle/ads/googleads/v16/enums/listing_group_filter_custom_attribute_index.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xb1\x01\n*ListingGroupFilterCustomAttributeIndexEnum\"\x82\x01\n&ListingGroupFilterCustomAttributeIndex\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\n\n\x06INDEX0\x10\x02\x12\n\n\x06INDEX1\x10\x03\x12\n\n\x06INDEX2\x10\x04\x12\n\n\x06INDEX3\x10\x05\x12\n\n\x06INDEX4\x10\x06\x42\x85\x02\n\"com.google.ads.googleads.v16.enumsB+ListingGroupFilterCustomAttributeIndexProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingGroupFilterCustomAttributeIndexEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterCustomAttributeIndexEnum").msgclass + ListingGroupFilterCustomAttributeIndexEnum::ListingGroupFilterCustomAttributeIndex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterCustomAttributeIndexEnum.ListingGroupFilterCustomAttributeIndex").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_group_filter_listing_source_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_group_filter_listing_source_pb.rb new file mode 100644 index 000000000..3f11aab18 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_group_filter_listing_source_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_group_filter_listing_source.proto + +require 'google/protobuf' + + +descriptor_data = "\nHgoogle/ads/googleads/v16/enums/listing_group_filter_listing_source.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x81\x01\n#ListingGroupFilterListingSourceEnum\"Z\n\x1fListingGroupFilterListingSource\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08SHOPPING\x10\x02\x12\x0b\n\x07WEBPAGE\x10\x03\x42\xfe\x01\n\"com.google.ads.googleads.v16.enumsB$ListingGroupFilterListingSourceProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingGroupFilterListingSourceEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterListingSourceEnum").msgclass + ListingGroupFilterListingSourceEnum::ListingGroupFilterListingSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterListingSourceEnum.ListingGroupFilterListingSource").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_category_level_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_category_level_pb.rb new file mode 100644 index 000000000..f1d411af4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_category_level_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_group_filter_product_category_level.proto + +require 'google/protobuf' + + +descriptor_data = "\nPgoogle/ads/googleads/v16/enums/listing_group_filter_product_category_level.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xb1\x01\n*ListingGroupFilterProductCategoryLevelEnum\"\x82\x01\n&ListingGroupFilterProductCategoryLevel\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\n\n\x06LEVEL1\x10\x02\x12\n\n\x06LEVEL2\x10\x03\x12\n\n\x06LEVEL3\x10\x04\x12\n\n\x06LEVEL4\x10\x05\x12\n\n\x06LEVEL5\x10\x06\x42\x85\x02\n\"com.google.ads.googleads.v16.enumsB+ListingGroupFilterProductCategoryLevelProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingGroupFilterProductCategoryLevelEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterProductCategoryLevelEnum").msgclass + ListingGroupFilterProductCategoryLevelEnum::ListingGroupFilterProductCategoryLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterProductCategoryLevelEnum.ListingGroupFilterProductCategoryLevel").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_channel_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_channel_pb.rb new file mode 100644 index 000000000..203add29d --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_channel_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_group_filter_product_channel.proto + +require 'google/protobuf' + + +descriptor_data = "\nIgoogle/ads/googleads/v16/enums/listing_group_filter_product_channel.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x7f\n$ListingGroupFilterProductChannelEnum\"W\n ListingGroupFilterProductChannel\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\n\n\x06ONLINE\x10\x02\x12\t\n\x05LOCAL\x10\x03\x42\xff\x01\n\"com.google.ads.googleads.v16.enumsB%ListingGroupFilterProductChannelProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingGroupFilterProductChannelEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterProductChannelEnum").msgclass + ListingGroupFilterProductChannelEnum::ListingGroupFilterProductChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterProductChannelEnum.ListingGroupFilterProductChannel").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_condition_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_condition_pb.rb new file mode 100644 index 000000000..180ac777e --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_condition_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_group_filter_product_condition.proto + +require 'google/protobuf' + + +descriptor_data = "\nKgoogle/ads/googleads/v16/enums/listing_group_filter_product_condition.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x90\x01\n&ListingGroupFilterProductConditionEnum\"f\n\"ListingGroupFilterProductCondition\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x07\n\x03NEW\x10\x02\x12\x0f\n\x0bREFURBISHED\x10\x03\x12\x08\n\x04USED\x10\x04\x42\x81\x02\n\"com.google.ads.googleads.v16.enumsB\'ListingGroupFilterProductConditionProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingGroupFilterProductConditionEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterProductConditionEnum").msgclass + ListingGroupFilterProductConditionEnum::ListingGroupFilterProductCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterProductConditionEnum.ListingGroupFilterProductCondition").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_type_level_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_type_level_pb.rb new file mode 100644 index 000000000..7456eace2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_group_filter_product_type_level_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_group_filter_product_type_level.proto + +require 'google/protobuf' + + +descriptor_data = "\nLgoogle/ads/googleads/v16/enums/listing_group_filter_product_type_level.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xa8\x01\n&ListingGroupFilterProductTypeLevelEnum\"~\n\"ListingGroupFilterProductTypeLevel\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\n\n\x06LEVEL1\x10\x02\x12\n\n\x06LEVEL2\x10\x03\x12\n\n\x06LEVEL3\x10\x04\x12\n\n\x06LEVEL4\x10\x05\x12\n\n\x06LEVEL5\x10\x06\x42\x81\x02\n\"com.google.ads.googleads.v16.enumsB\'ListingGroupFilterProductTypeLevelProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingGroupFilterProductTypeLevelEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterProductTypeLevelEnum").msgclass + ListingGroupFilterProductTypeLevelEnum::ListingGroupFilterProductTypeLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterProductTypeLevelEnum.ListingGroupFilterProductTypeLevel").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_group_filter_type_enum_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_group_filter_type_enum_pb.rb new file mode 100644 index 000000000..c54131bf3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_group_filter_type_enum_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_group_filter_type_enum.proto + +require 'google/protobuf' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/enums/listing_group_filter_type_enum.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x8b\x01\n\x1aListingGroupFilterTypeEnum\"m\n\x16ListingGroupFilterType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0f\n\x0bSUBDIVISION\x10\x02\x12\x11\n\rUNIT_INCLUDED\x10\x03\x12\x11\n\rUNIT_EXCLUDED\x10\x04\x42\xf9\x01\n\"com.google.ads.googleads.v16.enumsB\x1fListingGroupFilterTypeEnumProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingGroupFilterTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterTypeEnum").msgclass + ListingGroupFilterTypeEnum::ListingGroupFilterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupFilterTypeEnum.ListingGroupFilterType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_group_type_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_group_type_pb.rb new file mode 100644 index 000000000..3aefe3786 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_group_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_group_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n7google/ads/googleads/v16/enums/listing_group_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"c\n\x14ListingGroupTypeEnum\"K\n\x10ListingGroupType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0f\n\x0bSUBDIVISION\x10\x02\x12\x08\n\x04UNIT\x10\x03\x42\xef\x01\n\"com.google.ads.googleads.v16.enumsB\x15ListingGroupTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingGroupTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupTypeEnum").msgclass + ListingGroupTypeEnum::ListingGroupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingGroupTypeEnum.ListingGroupType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/listing_type_pb.rb b/lib/google/ads/google_ads/v16/enums/listing_type_pb.rb new file mode 100644 index 000000000..8e5815147 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/listing_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/listing_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/ads/googleads/v16/enums/listing_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"L\n\x0fListingTypeEnum\"9\n\x0bListingType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08VEHICLES\x10\x02\x42\xea\x01\n\"com.google.ads.googleads.v16.enumsB\x10ListingTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ListingTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingTypeEnum").msgclass + ListingTypeEnum::ListingType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ListingTypeEnum.ListingType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/local_placeholder_field_pb.rb b/lib/google/ads/google_ads/v16/enums/local_placeholder_field_pb.rb new file mode 100644 index 000000000..97aa43bca --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/local_placeholder_field_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/local_placeholder_field.proto + +require 'google/protobuf' + + +descriptor_data = "\n\n:SHARED_SETS_PER_CUSTOMER_FOR_NEGATIVE_PLACEMENT_LIST_LOWER\x10)\x12;\n7HOTEL_ADVANCE_BOOKING_WINDOW_BID_MODIFIERS_PER_AD_GROUP\x10,\x12#\n\x1f\x42IDDING_STRATEGIES_PER_CUSTOMER\x10-\x12!\n\x1d\x42\x41SIC_USER_LISTS_PER_CUSTOMER\x10/\x12#\n\x1fLOGICAL_USER_LISTS_PER_CUSTOMER\x10\x30\x12\'\n\"RULE_BASED_USER_LISTS_PER_CUSTOMER\x10\x99\x01\x12\"\n\x1e\x42\x41SE_AD_GROUP_ADS_PER_CUSTOMER\x10\x35\x12(\n$EXPERIMENT_AD_GROUP_ADS_PER_CUSTOMER\x10\x36\x12\x1d\n\x19\x41\x44_GROUP_ADS_PER_CAMPAIGN\x10\x37\x12#\n\x1fTEXT_AND_OTHER_ADS_PER_AD_GROUP\x10\x38\x12\x1a\n\x16IMAGE_ADS_PER_AD_GROUP\x10\x39\x12#\n\x1fSHOPPING_SMART_ADS_PER_AD_GROUP\x10:\x12&\n\"RESPONSIVE_SEARCH_ADS_PER_AD_GROUP\x10;\x12\x18\n\x14\x41PP_ADS_PER_AD_GROUP\x10<\x12#\n\x1f\x41PP_ENGAGEMENT_ADS_PER_AD_GROUP\x10=\x12\x1a\n\x16LOCAL_ADS_PER_AD_GROUP\x10>\x12\x1a\n\x16VIDEO_ADS_PER_AD_GROUP\x10?\x12+\n&LEAD_FORM_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\x8f\x01\x12*\n&PROMOTION_CUSTOMER_ASSETS_PER_CUSTOMER\x10O\x12*\n&PROMOTION_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10P\x12*\n&PROMOTION_AD_GROUP_ASSETS_PER_AD_GROUP\x10Q\x12)\n$CALLOUT_CUSTOMER_ASSETS_PER_CUSTOMER\x10\x86\x01\x12)\n$CALLOUT_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\x87\x01\x12)\n$CALLOUT_AD_GROUP_ASSETS_PER_AD_GROUP\x10\x88\x01\x12*\n%SITELINK_CUSTOMER_ASSETS_PER_CUSTOMER\x10\x89\x01\x12*\n%SITELINK_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\x8a\x01\x12*\n%SITELINK_AD_GROUP_ASSETS_PER_AD_GROUP\x10\x8b\x01\x12\x34\n/STRUCTURED_SNIPPET_CUSTOMER_ASSETS_PER_CUSTOMER\x10\x8c\x01\x12\x34\n/STRUCTURED_SNIPPET_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\x8d\x01\x12\x34\n/STRUCTURED_SNIPPET_AD_GROUP_ASSETS_PER_AD_GROUP\x10\x8e\x01\x12,\n\'MOBILE_APP_CUSTOMER_ASSETS_PER_CUSTOMER\x10\x90\x01\x12,\n\'MOBILE_APP_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\x91\x01\x12,\n\'MOBILE_APP_AD_GROUP_ASSETS_PER_AD_GROUP\x10\x92\x01\x12/\n*HOTEL_CALLOUT_CUSTOMER_ASSETS_PER_CUSTOMER\x10\x93\x01\x12/\n*HOTEL_CALLOUT_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\x94\x01\x12/\n*HOTEL_CALLOUT_AD_GROUP_ASSETS_PER_AD_GROUP\x10\x95\x01\x12&\n!CALL_CUSTOMER_ASSETS_PER_CUSTOMER\x10\x96\x01\x12&\n!CALL_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\x97\x01\x12&\n!CALL_AD_GROUP_ASSETS_PER_AD_GROUP\x10\x98\x01\x12\'\n\"PRICE_CUSTOMER_ASSETS_PER_CUSTOMER\x10\x9a\x01\x12\'\n\"PRICE_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\x9b\x01\x12\'\n\"PRICE_AD_GROUP_ASSETS_PER_AD_GROUP\x10\x9c\x01\x12*\n%AD_IMAGE_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\xaf\x01\x12*\n%AD_IMAGE_AD_GROUP_ASSETS_PER_AD_GROUP\x10\xb0\x01\x12&\n!PAGE_FEED_ASSET_SETS_PER_CUSTOMER\x10\x9d\x01\x12\x33\n.DYNAMIC_EDUCATION_FEED_ASSET_SETS_PER_CUSTOMER\x10\x9e\x01\x12#\n\x1e\x41SSETS_PER_PAGE_FEED_ASSET_SET\x10\x9f\x01\x12\x30\n+ASSETS_PER_DYNAMIC_EDUCATION_FEED_ASSET_SET\x10\xa0\x01\x12\x30\n+DYNAMIC_REAL_ESTATE_ASSET_SETS_PER_CUSTOMER\x10\xa1\x01\x12-\n(ASSETS_PER_DYNAMIC_REAL_ESTATE_ASSET_SET\x10\xa2\x01\x12+\n&DYNAMIC_CUSTOM_ASSET_SETS_PER_CUSTOMER\x10\xa3\x01\x12(\n#ASSETS_PER_DYNAMIC_CUSTOM_ASSET_SET\x10\xa4\x01\x12\x37\n2DYNAMIC_HOTELS_AND_RENTALS_ASSET_SETS_PER_CUSTOMER\x10\xa5\x01\x12\x34\n/ASSETS_PER_DYNAMIC_HOTELS_AND_RENTALS_ASSET_SET\x10\xa6\x01\x12*\n%DYNAMIC_LOCAL_ASSET_SETS_PER_CUSTOMER\x10\xa7\x01\x12\'\n\"ASSETS_PER_DYNAMIC_LOCAL_ASSET_SET\x10\xa8\x01\x12,\n\'DYNAMIC_FLIGHTS_ASSET_SETS_PER_CUSTOMER\x10\xa9\x01\x12)\n$ASSETS_PER_DYNAMIC_FLIGHTS_ASSET_SET\x10\xaa\x01\x12+\n&DYNAMIC_TRAVEL_ASSET_SETS_PER_CUSTOMER\x10\xab\x01\x12(\n#ASSETS_PER_DYNAMIC_TRAVEL_ASSET_SET\x10\xac\x01\x12)\n$DYNAMIC_JOBS_ASSET_SETS_PER_CUSTOMER\x10\xad\x01\x12&\n!ASSETS_PER_DYNAMIC_JOBS_ASSET_SET\x10\xae\x01\x12/\n*BUSINESS_NAME_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\xb3\x01\x12/\n*BUSINESS_LOGO_CAMPAIGN_ASSETS_PER_CAMPAIGN\x10\xb4\x01\x12\x13\n\x0fVERSIONS_PER_AD\x10R\x12\x1b\n\x17USER_FEEDS_PER_CUSTOMER\x10Z\x12\x1d\n\x19SYSTEM_FEEDS_PER_CUSTOMER\x10[\x12\x1c\n\x18\x46\x45\x45\x44_ATTRIBUTES_PER_FEED\x10\\\x12\x1b\n\x17\x46\x45\x45\x44_ITEMS_PER_CUSTOMER\x10^\x12\x1f\n\x1b\x43\x41MPAIGN_FEEDS_PER_CUSTOMER\x10_\x12$\n BASE_CAMPAIGN_FEEDS_PER_CUSTOMER\x10`\x12*\n&EXPERIMENT_CAMPAIGN_FEEDS_PER_CUSTOMER\x10m\x12\x1f\n\x1b\x41\x44_GROUP_FEEDS_PER_CUSTOMER\x10\x61\x12$\n BASE_AD_GROUP_FEEDS_PER_CUSTOMER\x10\x62\x12*\n&EXPERIMENT_AD_GROUP_FEEDS_PER_CUSTOMER\x10n\x12\x1f\n\x1b\x41\x44_GROUP_FEEDS_PER_CAMPAIGN\x10\x63\x12\x1f\n\x1b\x46\x45\x45\x44_ITEM_SETS_PER_CUSTOMER\x10\x64\x12 \n\x1c\x46\x45\x45\x44_ITEMS_PER_FEED_ITEM_SET\x10\x65\x12%\n!CAMPAIGN_EXPERIMENTS_PER_CUSTOMER\x10p\x12(\n$EXPERIMENT_ARMS_PER_VIDEO_EXPERIMENT\x10q\x12\x1d\n\x19OWNED_LABELS_PER_CUSTOMER\x10s\x12\x17\n\x13LABELS_PER_CAMPAIGN\x10u\x12\x17\n\x13LABELS_PER_AD_GROUP\x10v\x12\x1a\n\x16LABELS_PER_AD_GROUP_AD\x10w\x12!\n\x1dLABELS_PER_AD_GROUP_CRITERION\x10x\x12\x1e\n\x1aTARGET_CUSTOMERS_PER_LABEL\x10y\x12\'\n#KEYWORD_PLANS_PER_USER_PER_CUSTOMER\x10z\x12\x33\n/KEYWORD_PLAN_AD_GROUP_KEYWORDS_PER_KEYWORD_PLAN\x10{\x12+\n\'KEYWORD_PLAN_AD_GROUPS_PER_KEYWORD_PLAN\x10|\x12\x33\n/KEYWORD_PLAN_NEGATIVE_KEYWORDS_PER_KEYWORD_PLAN\x10}\x12+\n\'KEYWORD_PLAN_CAMPAIGNS_PER_KEYWORD_PLAN\x10~\x12$\n\x1f\x43ONVERSION_ACTIONS_PER_CUSTOMER\x10\x80\x01\x12!\n\x1c\x42\x41TCH_JOB_OPERATIONS_PER_JOB\x10\x82\x01\x12\x1c\n\x17\x42\x41TCH_JOBS_PER_CUSTOMER\x10\x83\x01\x12\x39\n4HOTEL_CHECK_IN_DATE_RANGE_BID_MODIFIERS_PER_AD_GROUP\x10\x84\x01\x12@\n;SHARED_SETS_PER_ACCOUNT_FOR_ACCOUNT_LEVEL_NEGATIVE_KEYWORDS\x10\xb1\x01\x12\x33\n.ACCOUNT_LEVEL_NEGATIVE_KEYWORDS_PER_SHARED_SET\x10\xb2\x01\x12/\n*ENABLED_ASSET_PER_HOTEL_PROPERTY_ASSET_SET\x10\xb5\x01\x12\x37\n2ENABLED_HOTEL_PROPERTY_ASSET_LINKS_PER_ASSET_GROUP\x10\xb6\x01\x12\x1a\n\x15\x42RANDS_PER_SHARED_SET\x10\xb7\x01\x12-\n(ENABLED_BRAND_LIST_CRITERIA_PER_CAMPAIGN\x10\xb8\x01\x12&\n!SHARED_SETS_PER_ACCOUNT_FOR_BRAND\x10\xb9\x01\x42\xf0\x01\n\"com.google.ads.googleads.v16.enumsB\x16ResourceLimitTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ResourceLimitTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ResourceLimitTypeEnum").msgclass + ResourceLimitTypeEnum::ResourceLimitType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ResourceLimitTypeEnum.ResourceLimitType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/response_content_type_pb.rb b/lib/google/ads/google_ads/v16/enums/response_content_type_pb.rb new file mode 100644 index 000000000..206328871 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/response_content_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/response_content_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/ads/googleads/v16/enums/response_content_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"o\n\x17ResponseContentTypeEnum\"T\n\x13ResponseContentType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x16\n\x12RESOURCE_NAME_ONLY\x10\x01\x12\x14\n\x10MUTABLE_RESOURCE\x10\x02\x42\xf2\x01\n\"com.google.ads.googleads.v16.enumsB\x18ResponseContentTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + ResponseContentTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ResponseContentTypeEnum").msgclass + ResponseContentTypeEnum::ResponseContentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/search_engine_results_page_type_pb.rb b/lib/google/ads/google_ads/v16/enums/search_engine_results_page_type_pb.rb new file mode 100644 index 000000000..cc2a0010d --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/search_engine_results_page_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/search_engine_results_page_type.proto + +require 'google/protobuf' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/enums/search_engine_results_page_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x93\x01\n\x1fSearchEngineResultsPageTypeEnum\"p\n\x1bSearchEngineResultsPageType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08\x41\x44S_ONLY\x10\x02\x12\x10\n\x0cORGANIC_ONLY\x10\x03\x12\x13\n\x0f\x41\x44S_AND_ORGANIC\x10\x04\x42\xfa\x01\n\"com.google.ads.googleads.v16.enumsB SearchEngineResultsPageTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + SearchEngineResultsPageTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.SearchEngineResultsPageTypeEnum").msgclass + SearchEngineResultsPageTypeEnum::SearchEngineResultsPageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.SearchEngineResultsPageTypeEnum.SearchEngineResultsPageType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/search_term_match_type_pb.rb b/lib/google/ads/google_ads/v16/enums/search_term_match_type_pb.rb new file mode 100644 index 000000000..5ebc02092 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/search_term_match_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/search_term_match_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n;google/ads/googleads/v16/enums/search_term_match_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x91\x01\n\x17SearchTermMatchTypeEnum\"v\n\x13SearchTermMatchType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\t\n\x05\x42ROAD\x10\x02\x12\t\n\x05\x45XACT\x10\x03\x12\n\n\x06PHRASE\x10\x04\x12\x0e\n\nNEAR_EXACT\x10\x05\x12\x0f\n\x0bNEAR_PHRASE\x10\x06\x42\xf2\x01\n\"com.google.ads.googleads.v16.enumsB\x18SearchTermMatchTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + SearchTermMatchTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.SearchTermMatchTypeEnum").msgclass + SearchTermMatchTypeEnum::SearchTermMatchType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.SearchTermMatchTypeEnum.SearchTermMatchType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/search_term_targeting_status_pb.rb b/lib/google/ads/google_ads/v16/enums/search_term_targeting_status_pb.rb new file mode 100644 index 000000000..22d39c786 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/search_term_targeting_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/search_term_targeting_status.proto + +require 'google/protobuf' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/enums/search_term_targeting_status.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x91\x01\n\x1dSearchTermTargetingStatusEnum\"p\n\x19SearchTermTargetingStatus\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x02\x12\x0c\n\x08\x45XCLUDED\x10\x03\x12\x12\n\x0e\x41\x44\x44\x45\x44_EXCLUDED\x10\x04\x12\x08\n\x04NONE\x10\x05\x42\xf8\x01\n\"com.google.ads.googleads.v16.enumsB\x1eSearchTermTargetingStatusProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + SearchTermTargetingStatusEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.SearchTermTargetingStatusEnum").msgclass + SearchTermTargetingStatusEnum::SearchTermTargetingStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.SearchTermTargetingStatusEnum.SearchTermTargetingStatus").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/seasonality_event_scope_pb.rb b/lib/google/ads/google_ads/v16/enums/seasonality_event_scope_pb.rb new file mode 100644 index 000000000..25d3cea07 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/seasonality_event_scope_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/seasonality_event_scope.proto + +require 'google/protobuf' + + +descriptor_data = "\n\n\x08TimeType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x07\n\x03NOW\x10\x02\x12\x0b\n\x07\x46OREVER\x10\x03\x42\xe7\x01\n\"com.google.ads.googleads.v16.enumsB\rTimeTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + TimeTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.TimeTypeEnum").msgclass + TimeTypeEnum::TimeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.TimeTypeEnum.TimeType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/tracking_code_page_format_pb.rb b/lib/google/ads/google_ads/v16/enums/tracking_code_page_format_pb.rb new file mode 100644 index 000000000..6930c8283 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/tracking_code_page_format_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/tracking_code_page_format.proto + +require 'google/protobuf' + + +descriptor_data = "\n>google/ads/googleads/v16/enums/tracking_code_page_format.proto\x12\x1egoogle.ads.googleads.v16.enums\"g\n\x1aTrackingCodePageFormatEnum\"I\n\x16TrackingCodePageFormat\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x08\n\x04HTML\x10\x02\x12\x07\n\x03\x41MP\x10\x03\x42\xf5\x01\n\"com.google.ads.googleads.v16.enumsB\x1bTrackingCodePageFormatProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + TrackingCodePageFormatEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.TrackingCodePageFormatEnum").msgclass + TrackingCodePageFormatEnum::TrackingCodePageFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.TrackingCodePageFormatEnum.TrackingCodePageFormat").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/tracking_code_type_pb.rb b/lib/google/ads/google_ads/v16/enums/tracking_code_type_pb.rb new file mode 100644 index 000000000..67b80af4f --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/tracking_code_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/tracking_code_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n7google/ads/googleads/v16/enums/tracking_code_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\x8f\x01\n\x14TrackingCodeTypeEnum\"w\n\x10TrackingCodeType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07WEBPAGE\x10\x02\x12\x13\n\x0fWEBPAGE_ONCLICK\x10\x03\x12\x11\n\rCLICK_TO_CALL\x10\x04\x12\x10\n\x0cWEBSITE_CALL\x10\x05\x42\xef\x01\n\"com.google.ads.googleads.v16.enumsB\x15TrackingCodeTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + TrackingCodeTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.TrackingCodeTypeEnum").msgclass + TrackingCodeTypeEnum::TrackingCodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.TrackingCodeTypeEnum.TrackingCodeType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/travel_placeholder_field_pb.rb b/lib/google/ads/google_ads/v16/enums/travel_placeholder_field_pb.rb new file mode 100644 index 000000000..13d1d0e1e --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/travel_placeholder_field_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/travel_placeholder_field.proto + +require 'google/protobuf' + + +descriptor_data = "\n=google/ads/googleads/v16/enums/travel_placeholder_field.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xd6\x03\n\x1aTravelPlaceholderFieldEnum\"\xb7\x03\n\x16TravelPlaceholderField\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x12\n\x0e\x44\x45STINATION_ID\x10\x02\x12\r\n\tORIGIN_ID\x10\x03\x12\t\n\x05TITLE\x10\x04\x12\x14\n\x10\x44\x45STINATION_NAME\x10\x05\x12\x0f\n\x0bORIGIN_NAME\x10\x06\x12\t\n\x05PRICE\x10\x07\x12\x13\n\x0f\x46ORMATTED_PRICE\x10\x08\x12\x0e\n\nSALE_PRICE\x10\t\x12\x18\n\x14\x46ORMATTED_SALE_PRICE\x10\n\x12\r\n\tIMAGE_URL\x10\x0b\x12\x0c\n\x08\x43\x41TEGORY\x10\x0c\x12\x17\n\x13\x43ONTEXTUAL_KEYWORDS\x10\r\x12\x17\n\x13\x44\x45STINATION_ADDRESS\x10\x0e\x12\r\n\tFINAL_URL\x10\x0f\x12\x15\n\x11\x46INAL_MOBILE_URLS\x10\x10\x12\x10\n\x0cTRACKING_URL\x10\x11\x12\x14\n\x10\x41NDROID_APP_LINK\x10\x12\x12\x1b\n\x17SIMILAR_DESTINATION_IDS\x10\x13\x12\x10\n\x0cIOS_APP_LINK\x10\x14\x12\x14\n\x10IOS_APP_STORE_ID\x10\x15\x42\xf5\x01\n\"com.google.ads.googleads.v16.enumsB\x1bTravelPlaceholderFieldProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + TravelPlaceholderFieldEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.TravelPlaceholderFieldEnum").msgclass + TravelPlaceholderFieldEnum::TravelPlaceholderField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.TravelPlaceholderFieldEnum.TravelPlaceholderField").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/user_identifier_source_pb.rb b/lib/google/ads/google_ads/v16/enums/user_identifier_source_pb.rb new file mode 100644 index 000000000..5d13f85b0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/user_identifier_source_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/user_identifier_source.proto + +require 'google/protobuf' + + +descriptor_data = "\n;google/ads/googleads/v16/enums/user_identifier_source.proto\x12\x1egoogle.ads.googleads.v16.enums\"r\n\x18UserIdentifierSourceEnum\"V\n\x14UserIdentifierSource\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0f\n\x0b\x46IRST_PARTY\x10\x02\x12\x0f\n\x0bTHIRD_PARTY\x10\x03\x42\xf3\x01\n\"com.google.ads.googleads.v16.enumsB\x19UserIdentifierSourceProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + UserIdentifierSourceEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.UserIdentifierSourceEnum").msgclass + UserIdentifierSourceEnum::UserIdentifierSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.UserIdentifierSourceEnum.UserIdentifierSource").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/user_interest_taxonomy_type_pb.rb b/lib/google/ads/google_ads/v16/enums/user_interest_taxonomy_type_pb.rb new file mode 100644 index 000000000..6abc4cb7f --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/user_interest_taxonomy_type_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/user_interest_taxonomy_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n@google/ads/googleads/v16/enums/user_interest_taxonomy_type.proto\x12\x1egoogle.ads.googleads.v16.enums\"\xbf\x01\n\x1cUserInterestTaxonomyTypeEnum\"\x9e\x01\n\x18UserInterestTaxonomyType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08\x41\x46\x46INITY\x10\x02\x12\r\n\tIN_MARKET\x10\x03\x12\x1b\n\x17MOBILE_APP_INSTALL_USER\x10\x04\x12\x10\n\x0cVERTICAL_GEO\x10\x05\x12\x18\n\x14NEW_SMART_PHONE_USER\x10\x06\x42\xf7\x01\n\"com.google.ads.googleads.v16.enumsB\x1dUserInterestTaxonomyTypeProtoP\x01ZCgoogle.golang.org/genproto/googleapis/ads/googleads/v16/enums;enums\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V16.Enums\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V16\\Enums\xea\x02\"Google::Ads::GoogleAds::V16::Enumsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Enums + UserInterestTaxonomyTypeEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.UserInterestTaxonomyTypeEnum").msgclass + UserInterestTaxonomyTypeEnum::UserInterestTaxonomyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.enums.UserInterestTaxonomyTypeEnum.UserInterestTaxonomyType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/enums/user_list_access_status_pb.rb b/lib/google/ads/google_ads/v16/enums/user_list_access_status_pb.rb new file mode 100644 index 000000000..7b9faf09a --- /dev/null +++ b/lib/google/ads/google_ads/v16/enums/user_list_access_status_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/enums/user_list_access_status.proto + +require 'google/protobuf' + + +descriptor_data = "\n\x12\x18\n\x14MISSING_DESCRIPTION1\x10?\x12\x18\n\x14MISSING_DESCRIPTION2\x10@\x12\x1f\n\x1bMISSING_DESTINATION_URL_TAG\x10\x41\x12 \n\x1cMISSING_LANDING_PAGE_URL_TAG\x10\x42\x12\x15\n\x11MISSING_DIMENSION\x10\x43\x12\x17\n\x13MISSING_DISPLAY_URL\x10\x44\x12\x14\n\x10MISSING_HEADLINE\x10\x45\x12\x12\n\x0eMISSING_HEIGHT\x10\x46\x12\x11\n\rMISSING_IMAGE\x10G\x12-\n)MISSING_MARKETING_IMAGE_OR_PRODUCT_VIDEOS\x10H\x12\x1c\n\x18MISSING_MARKUP_LANGUAGES\x10I\x12\x1a\n\x16MISSING_MOBILE_CARRIER\x10J\x12\x11\n\rMISSING_PHONE\x10K\x12$\n MISSING_REQUIRED_TEMPLATE_FIELDS\x10L\x12 \n\x1cMISSING_TEMPLATE_FIELD_VALUE\x10M\x12\x10\n\x0cMISSING_TEXT\x10N\x12\x17\n\x13MISSING_VISIBLE_URL\x10O\x12\x11\n\rMISSING_WIDTH\x10P\x12\'\n#MULTIPLE_DISTINCT_FEEDS_UNSUPPORTED\x10Q\x12$\n MUST_USE_TEMP_AD_UNION_ID_ON_ADD\x10R\x12\x0c\n\x08TOO_LONG\x10S\x12\r\n\tTOO_SHORT\x10T\x12\"\n\x1eUNION_DIMENSIONS_CANNOT_CHANGE\x10U\x12\x1d\n\x19UNKNOWN_ADDRESS_COMPONENT\x10V\x12\x16\n\x12UNKNOWN_FIELD_NAME\x10W\x12\x17\n\x13UNKNOWN_UNIQUE_NAME\x10X\x12\x1a\n\x16UNSUPPORTED_DIMENSIONS\x10Y\x12\x16\n\x12URL_INVALID_SCHEME\x10Z\x12 \n\x1cURL_INVALID_TOP_LEVEL_DOMAIN\x10[\x12\x11\n\rURL_MALFORMED\x10\\\x12\x0f\n\x0bURL_NO_HOST\x10]\x12\x16\n\x12URL_NOT_EQUIVALENT\x10^\x12\x1a\n\x16URL_HOST_NAME_TOO_LONG\x10_\x12\x11\n\rURL_NO_SCHEME\x10`\x12\x1b\n\x17URL_NO_TOP_LEVEL_DOMAIN\x10\x61\x12\x18\n\x14URL_PATH_NOT_ALLOWED\x10\x62\x12\x18\n\x14URL_PORT_NOT_ALLOWED\x10\x63\x12\x19\n\x15URL_QUERY_NOT_ALLOWED\x10\x64\x12\x34\n0URL_SCHEME_BEFORE_EXPANDED_DYNAMIC_SEARCH_AD_TAG\x10\x66\x12)\n%USER_DOES_NOT_HAVE_ACCESS_TO_TEMPLATE\x10g\x12$\n INCONSISTENT_EXPANDABLE_SETTINGS\x10h\x12\x12\n\x0eINVALID_FORMAT\x10i\x12\x16\n\x12INVALID_FIELD_TEXT\x10j\x12\x17\n\x13\x45LEMENT_NOT_PRESENT\x10k\x12\x0f\n\x0bIMAGE_ERROR\x10l\x12\x16\n\x12VALUE_NOT_IN_RANGE\x10m\x12\x15\n\x11\x46IELD_NOT_PRESENT\x10n\x12\x18\n\x14\x41\x44\x44RESS_NOT_COMPLETE\x10o\x12\x13\n\x0f\x41\x44\x44RESS_INVALID\x10p\x12\x19\n\x15VIDEO_RETRIEVAL_ERROR\x10q\x12\x0f\n\x0b\x41UDIO_ERROR\x10r\x12\x1f\n\x1bINVALID_YOUTUBE_DISPLAY_URL\x10s\x12\x1b\n\x17TOO_MANY_PRODUCT_IMAGES\x10t\x12\x1b\n\x17TOO_MANY_PRODUCT_VIDEOS\x10u\x12.\n*INCOMPATIBLE_AD_TYPE_AND_DEVICE_PREFERENCE\x10v\x12*\n&CALLTRACKING_NOT_SUPPORTED_FOR_COUNTRY\x10w\x12-\n)CARRIER_SPECIFIC_SHORT_NUMBER_NOT_ALLOWED\x10x\x12\x1a\n\x16\x44ISALLOWED_NUMBER_TYPE\x10y\x12*\n&PHONE_NUMBER_NOT_SUPPORTED_FOR_COUNTRY\x10z\x12<\n8PHONE_NUMBER_NOT_SUPPORTED_WITH_CALLTRACKING_FOR_COUNTRY\x10{\x12#\n\x1fPREMIUM_RATE_NUMBER_NOT_ALLOWED\x10|\x12#\n\x1fVANITY_PHONE_NUMBER_NOT_ALLOWED\x10}\x12#\n\x1fINVALID_CALL_CONVERSION_TYPE_ID\x10~\x12=\n9CANNOT_DISABLE_CALL_CONVERSION_AND_SET_CONVERSION_TYPE_ID\x10\x7f\x12#\n\x1e\x43\x41NNOT_SET_PATH2_WITHOUT_PATH1\x10\x80\x01\x12\x33\n.MISSING_DYNAMIC_SEARCH_ADS_SETTING_DOMAIN_NAME\x10\x81\x01\x12\'\n\"INCOMPATIBLE_WITH_RESTRICTION_TYPE\x10\x82\x01\x12\x31\n,CUSTOMER_CONSENT_FOR_CALL_RECORDING_REQUIRED\x10\x83\x01\x12\"\n\x1dMISSING_IMAGE_OR_MEDIA_BUNDLE\x10\x84\x01\x12\x30\n+PRODUCT_TYPE_NOT_SUPPORTED_IN_THIS_CAMPAIGN\x10\x85\x01\x12\x30\n+PLACEHOLDER_CANNOT_HAVE_EMPTY_DEFAULT_VALUE\x10\x86\x01\x12=\n8PLACEHOLDER_COUNTDOWN_FUNCTION_CANNOT_HAVE_DEFAULT_VALUE\x10\x87\x01\x12&\n!PLACEHOLDER_DEFAULT_VALUE_MISSING\x10\x88\x01\x12)\n$UNEXPECTED_PLACEHOLDER_DEFAULT_VALUE\x10\x89\x01\x12\'\n\"AD_CUSTOMIZERS_MAY_NOT_BE_ADJACENT\x10\x8a\x01\x12,\n\'UPDATING_AD_WITH_NO_ENABLED_ASSOCIATION\x10\x8b\x01\x12\x41\nCANNOT_ADD_ADGROUP_OF_TYPE_DSA_TO_CAMPAIGN_WITHOUT_DSA_SETTING\x10\x0e\x12\x37\n3PROMOTED_HOTEL_AD_GROUPS_NOT_AVAILABLE_FOR_CUSTOMER\x10\x0f\x12,\n(INVALID_EXCLUDED_PARENT_ASSET_FIELD_TYPE\x10\x10\x12*\n&INVALID_EXCLUDED_PARENT_ASSET_SET_TYPE\x10\x11\x12)\n%CANNOT_ADD_AD_GROUP_FOR_CAMPAIGN_TYPE\x10\x12\x12\x12\n\x0eINVALID_STATUS\x10\x13\x42\xf1\x01\n#com.google.ads.googleads.v16.errorsB\x11\x41\x64GroupErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AdGroupErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdGroupErrorEnum").msgclass + AdGroupErrorEnum::AdGroupError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdGroupErrorEnum.AdGroupError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/ad_group_feed_error_pb.rb b/lib/google/ads/google_ads/v16/errors/ad_group_feed_error_pb.rb new file mode 100644 index 000000000..2f9734865 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/ad_group_feed_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/ad_group_feed_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n9google/ads/googleads/v16/errors/ad_group_feed_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xdc\x02\n\x14\x41\x64GroupFeedErrorEnum\"\xc3\x02\n\x10\x41\x64GroupFeedError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12,\n(FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE\x10\x02\x12\"\n\x1e\x43\x41NNOT_CREATE_FOR_REMOVED_FEED\x10\x03\x12\x1f\n\x1b\x41\x44GROUP_FEED_ALREADY_EXISTS\x10\x04\x12*\n&CANNOT_OPERATE_ON_REMOVED_ADGROUP_FEED\x10\x05\x12\x1c\n\x18INVALID_PLACEHOLDER_TYPE\x10\x06\x12,\n(MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE\x10\x07\x12&\n\"NO_EXISTING_LOCATION_CUSTOMER_FEED\x10\x08\x42\xf5\x01\n#com.google.ads.googleads.v16.errorsB\x15\x41\x64GroupFeedErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AdGroupFeedErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdGroupFeedErrorEnum").msgclass + AdGroupFeedErrorEnum::AdGroupFeedError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdGroupFeedErrorEnum.AdGroupFeedError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/ad_parameter_error_pb.rb b/lib/google/ads/google_ads/v16/errors/ad_parameter_error_pb.rb new file mode 100644 index 000000000..6ff13689d --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/ad_parameter_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/ad_parameter_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/ads/googleads/v16/errors/ad_parameter_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x93\x01\n\x14\x41\x64ParameterErrorEnum\"{\n\x10\x41\x64ParameterError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12&\n\"AD_GROUP_CRITERION_MUST_BE_KEYWORD\x10\x02\x12!\n\x1dINVALID_INSERTION_TEXT_FORMAT\x10\x03\x42\xf5\x01\n#com.google.ads.googleads.v16.errorsB\x15\x41\x64ParameterErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AdParameterErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdParameterErrorEnum").msgclass + AdParameterErrorEnum::AdParameterError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdParameterErrorEnum.AdParameterError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/ad_sharing_error_pb.rb b/lib/google/ads/google_ads/v16/errors/ad_sharing_error_pb.rb new file mode 100644 index 000000000..a19aea269 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/ad_sharing_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/ad_sharing_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/ads/googleads/v16/errors/ad_sharing_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xa9\x01\n\x12\x41\x64SharingErrorEnum\"\x92\x01\n\x0e\x41\x64SharingError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12 \n\x1c\x41\x44_GROUP_ALREADY_CONTAINS_AD\x10\x02\x12\"\n\x1eINCOMPATIBLE_AD_UNDER_AD_GROUP\x10\x03\x12\x1c\n\x18\x43\x41NNOT_SHARE_INACTIVE_AD\x10\x04\x42\xf3\x01\n#com.google.ads.googleads.v16.errorsB\x13\x41\x64SharingErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AdSharingErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdSharingErrorEnum").msgclass + AdSharingErrorEnum::AdSharingError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdSharingErrorEnum.AdSharingError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/adx_error_pb.rb b/lib/google/ads/google_ads/v16/errors/adx_error_pb.rb new file mode 100644 index 000000000..d1bc0ab21 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/adx_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/adx_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/ads/googleads/v16/errors/adx_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"Q\n\x0c\x41\x64xErrorEnum\"A\n\x08\x41\x64xError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x17\n\x13UNSUPPORTED_FEATURE\x10\x02\x42\xed\x01\n#com.google.ads.googleads.v16.errorsB\rAdxErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AdxErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdxErrorEnum").msgclass + AdxErrorEnum::AdxError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AdxErrorEnum.AdxError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_error_pb.rb new file mode 100644 index 000000000..fbc1b08b6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/ads/googleads/v16/errors/asset_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xd7\x0b\n\x0e\x41ssetErrorEnum\"\xc4\x0b\n\nAssetError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12,\n(CUSTOMER_NOT_ON_ALLOWLIST_FOR_ASSET_TYPE\x10\r\x12\x13\n\x0f\x44UPLICATE_ASSET\x10\x03\x12\x18\n\x14\x44UPLICATE_ASSET_NAME\x10\x04\x12\x19\n\x15\x41SSET_DATA_IS_MISSING\x10\x05\x12\x1c\n\x18\x43\x41NNOT_MODIFY_ASSET_NAME\x10\x06\x12&\n\"FIELD_INCOMPATIBLE_WITH_ASSET_TYPE\x10\x07\x12\x1f\n\x1bINVALID_CALL_TO_ACTION_TEXT\x10\x08\x12(\n$LEAD_FORM_INVALID_FIELDS_COMBINATION\x10\t\x12\x1f\n\x1bLEAD_FORM_MISSING_AGREEMENT\x10\n\x12\x18\n\x14INVALID_ASSET_STATUS\x10\x0b\x12+\n\'FIELD_CANNOT_BE_MODIFIED_FOR_ASSET_TYPE\x10\x0c\x12\x1c\n\x18SCHEDULES_CANNOT_OVERLAP\x10\x0e\x12\x39\n5PROMOTION_CANNOT_SET_PERCENT_OFF_AND_MONEY_AMOUNT_OFF\x10\x0f\x12>\n:PROMOTION_CANNOT_SET_PROMOTION_CODE_AND_ORDERS_OVER_AMOUNT\x10\x10\x12%\n!TOO_MANY_DECIMAL_PLACES_SPECIFIED\x10\x11\x12/\n+DUPLICATE_ASSETS_WITH_DIFFERENT_FIELD_VALUE\x10\x12\x12\x32\n.CALL_CARRIER_SPECIFIC_SHORT_NUMBER_NOT_ALLOWED\x10\x13\x12\x35\n1CALL_CUSTOMER_CONSENT_FOR_CALL_RECORDING_REQUIRED\x10\x14\x12\x1f\n\x1b\x43\x41LL_DISALLOWED_NUMBER_TYPE\x10\x15\x12\"\n\x1e\x43\x41LL_INVALID_CONVERSION_ACTION\x10\x16\x12\x1d\n\x19\x43\x41LL_INVALID_COUNTRY_CODE\x10\x17\x12-\n)CALL_INVALID_DOMESTIC_PHONE_NUMBER_FORMAT\x10\x18\x12\x1d\n\x19\x43\x41LL_INVALID_PHONE_NUMBER\x10\x19\x12/\n+CALL_PHONE_NUMBER_NOT_SUPPORTED_FOR_COUNTRY\x10\x1a\x12(\n$CALL_PREMIUM_RATE_NUMBER_NOT_ALLOWED\x10\x1b\x12(\n$CALL_VANITY_PHONE_NUMBER_NOT_ALLOWED\x10\x1c\x12$\n PRICE_HEADER_SAME_AS_DESCRIPTION\x10\x1d\x12\x1d\n\x19MOBILE_APP_INVALID_APP_ID\x10\x1e\x12\x35\n1MOBILE_APP_INVALID_FINAL_URL_FOR_APP_DOWNLOAD_URL\x10\x1f\x12 \n\x1cNAME_REQUIRED_FOR_ASSET_TYPE\x10 \x12\x34\n0LEAD_FORM_LEGACY_QUALIFYING_QUESTIONS_DISALLOWED\x10!\x12 \n\x1cNAME_CONFLICT_FOR_ASSET_TYPE\x10\"\x12\x1e\n\x1a\x43\x41NNOT_MODIFY_ASSET_SOURCE\x10#\x12-\n)CANNOT_MODIFY_AUTOMATICALLY_CREATED_ASSET\x10$\x12-\n)LEAD_FORM_LOCATION_ANSWER_TYPE_DISALLOWED\x10%\x12 \n\x1cPAGE_FEED_INVALID_LABEL_TEXT\x10&B\xef\x01\n#com.google.ads.googleads.v16.errorsB\x0f\x41ssetErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetErrorEnum").msgclass + AssetErrorEnum::AssetError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetErrorEnum.AssetError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_group_asset_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_group_asset_error_pb.rb new file mode 100644 index 000000000..69b081751 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_group_asset_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_group_asset_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n=google/ads/googleads/v16/errors/asset_group_asset_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xeb\x01\n\x18\x41ssetGroupAssetErrorEnum\"\xce\x01\n\x14\x41ssetGroupAssetError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x16\n\x12\x44UPLICATE_RESOURCE\x10\x02\x12.\n*EXPANDABLE_TAGS_NOT_ALLOWED_IN_DESCRIPTION\x10\x03\x12\x1f\n\x1b\x41\x44_CUSTOMIZER_NOT_SUPPORTED\x10\x04\x12/\n+HOTEL_PROPERTY_ASSET_NOT_LINKED_TO_CAMPAIGN\x10\x05\x42\xf9\x01\n#com.google.ads.googleads.v16.errorsB\x19\x41ssetGroupAssetErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetGroupAssetErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetGroupAssetErrorEnum").msgclass + AssetGroupAssetErrorEnum::AssetGroupAssetError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetGroupAssetErrorEnum.AssetGroupAssetError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_group_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_group_error_pb.rb new file mode 100644 index 000000000..bf61c9eee --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_group_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_group_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n7google/ads/googleads/v16/errors/asset_group_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x9d\x05\n\x13\x41ssetGroupErrorEnum\"\x85\x05\n\x0f\x41ssetGroupError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x12\n\x0e\x44UPLICATE_NAME\x10\x02\x12,\n(CANNOT_ADD_ASSET_GROUP_FOR_CAMPAIGN_TYPE\x10\x03\x12\x1d\n\x19NOT_ENOUGH_HEADLINE_ASSET\x10\x04\x12\"\n\x1eNOT_ENOUGH_LONG_HEADLINE_ASSET\x10\x05\x12 \n\x1cNOT_ENOUGH_DESCRIPTION_ASSET\x10\x06\x12\"\n\x1eNOT_ENOUGH_BUSINESS_NAME_ASSET\x10\x07\x12$\n NOT_ENOUGH_MARKETING_IMAGE_ASSET\x10\x08\x12+\n\'NOT_ENOUGH_SQUARE_MARKETING_IMAGE_ASSET\x10\t\x12\x19\n\x15NOT_ENOUGH_LOGO_ASSET\x10\n\x12<\n8FINAL_URL_SHOPPING_MERCHANT_HOME_PAGE_URL_DOMAINS_DIFFER\x10\x0b\x12$\n PATH1_REQUIRED_WHEN_PATH2_IS_SET\x10\x0c\x12\x1e\n\x1aSHORT_DESCRIPTION_REQUIRED\x10\r\x12\x16\n\x12\x46INAL_URL_REQUIRED\x10\x0e\x12*\n&FINAL_URL_CONTAINS_INVALID_DOMAIN_NAME\x10\x0f\x12\x1f\n\x1b\x41\x44_CUSTOMIZER_NOT_SUPPORTED\x10\x10\x12\x32\n.CANNOT_MUTATE_ASSET_GROUP_FOR_REMOVED_CAMPAIGN\x10\x11\x42\xf4\x01\n#com.google.ads.googleads.v16.errorsB\x14\x41ssetGroupErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetGroupErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetGroupErrorEnum").msgclass + AssetGroupErrorEnum::AssetGroupError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetGroupErrorEnum.AssetGroupError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_group_listing_group_filter_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_group_listing_group_filter_error_pb.rb new file mode 100644 index 000000000..c84c7fc5f --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_group_listing_group_filter_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_group_listing_group_filter_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nLgoogle/ads/googleads/v16/errors/asset_group_listing_group_filter_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x9d\x07\n%AssetGroupListingGroupFilterErrorEnum\"\xf3\x06\n!AssetGroupListingGroupFilterError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x11\n\rTREE_TOO_DEEP\x10\x02\x12\x1d\n\x19UNIT_CANNOT_HAVE_CHILDREN\x10\x03\x12/\n+SUBDIVISION_MUST_HAVE_EVERYTHING_ELSE_CHILD\x10\x04\x12-\n)DIFFERENT_DIMENSION_TYPE_BETWEEN_SIBLINGS\x10\x05\x12)\n%SAME_DIMENSION_VALUE_BETWEEN_SIBLINGS\x10\x06\x12)\n%SAME_DIMENSION_TYPE_BETWEEN_ANCESTORS\x10\x07\x12\x12\n\x0eMULTIPLE_ROOTS\x10\x08\x12\x1b\n\x17INVALID_DIMENSION_VALUE\x10\t\x12(\n$MUST_REFINE_HIERARCHICAL_PARENT_TYPE\x10\n\x12$\n INVALID_PRODUCT_BIDDING_CATEGORY\x10\x0b\x12%\n!CHANGING_CASE_VALUE_WITH_CHILDREN\x10\x0c\x12\x1c\n\x18SUBDIVISION_HAS_CHILDREN\x10\r\x12.\n*CANNOT_REFINE_HIERARCHICAL_EVERYTHING_ELSE\x10\x0e\x12\x1e\n\x1a\x44IMENSION_TYPE_NOT_ALLOWED\x10\x0f\x12.\n*DUPLICATE_WEBPAGE_FILTER_UNDER_ASSET_GROUP\x10\x10\x12\x1e\n\x1aLISTING_SOURCE_NOT_ALLOWED\x10\x11\x12 \n\x1c\x46ILTER_EXCLUSION_NOT_ALLOWED\x10\x12\x12\x1c\n\x18MULTIPLE_LISTING_SOURCES\x10\x13\x12\x30\n,MULTIPLE_WEBPAGE_CONDITION_TYPES_NOT_ALLOWED\x10\x14\x12*\n&MULTIPLE_WEBPAGE_TYPES_PER_ASSET_GROUP\x10\x15\x12\x1f\n\x1bPAGE_FEED_FILTER_HAS_PARENT\x10\x16\x12#\n\x1fMULTIPLE_OPERATIONS_ON_ONE_NODE\x10\x17\x42\x86\x02\n#com.google.ads.googleads.v16.errorsB&AssetGroupListingGroupFilterErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetGroupListingGroupFilterErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetGroupListingGroupFilterErrorEnum").msgclass + AssetGroupListingGroupFilterErrorEnum::AssetGroupListingGroupFilterError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetGroupListingGroupFilterErrorEnum.AssetGroupListingGroupFilterError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_group_signal_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_group_signal_error_pb.rb new file mode 100644 index 000000000..f8acf4f04 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_group_signal_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_group_signal_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n>google/ads/googleads/v16/errors/asset_group_signal_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xb2\x01\n\x19\x41ssetGroupSignalErrorEnum\"\x94\x01\n\x15\x41ssetGroupSignalError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x12\n\x0eTOO_MANY_WORDS\x10\x02\x12!\n\x1dSEARCH_THEME_POLICY_VIOLATION\x10\x03\x12&\n\"AUDIENCE_WITH_WRONG_ASSET_GROUP_ID\x10\x04\x42\xfa\x01\n#com.google.ads.googleads.v16.errorsB\x1a\x41ssetGroupSignalErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetGroupSignalErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetGroupSignalErrorEnum").msgclass + AssetGroupSignalErrorEnum::AssetGroupSignalError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetGroupSignalErrorEnum.AssetGroupSignalError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_link_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_link_error_pb.rb new file mode 100644 index 000000000..ed6838a67 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_link_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_link_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/ads/googleads/v16/errors/asset_link_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xdc\x07\n\x12\x41ssetLinkErrorEnum\"\xc5\x07\n\x0e\x41ssetLinkError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x17\n\x13PINNING_UNSUPPORTED\x10\x02\x12\x1a\n\x16UNSUPPORTED_FIELD_TYPE\x10\x03\x12+\n\'FIELD_TYPE_INCOMPATIBLE_WITH_ASSET_TYPE\x10\x04\x12.\n*FIELD_TYPE_INCOMPATIBLE_WITH_CAMPAIGN_TYPE\x10\x05\x12)\n%INCOMPATIBLE_ADVERTISING_CHANNEL_TYPE\x10\x06\x12.\n*IMAGE_NOT_WITHIN_SPECIFIED_DIMENSION_RANGE\x10\x07\x12\x18\n\x14INVALID_PINNED_FIELD\x10\x08\x12*\n&MEDIA_BUNDLE_ASSET_FILE_SIZE_TOO_LARGE\x10\t\x12:\n6NOT_ENOUGH_AVAILABLE_ASSET_LINKS_FOR_VALID_COMBINATION\x10\n\x12\x32\n.NOT_ENOUGH_AVAILABLE_ASSET_LINKS_WITH_FALLBACK\x10\x0b\x12H\nDNOT_ENOUGH_AVAILABLE_ASSET_LINKS_WITH_FALLBACK_FOR_VALID_COMBINATION\x10\x0c\x12\x19\n\x15YOUTUBE_VIDEO_REMOVED\x10\r\x12\x1a\n\x16YOUTUBE_VIDEO_TOO_LONG\x10\x0e\x12\x1b\n\x17YOUTUBE_VIDEO_TOO_SHORT\x10\x0f\x12\x1e\n\x1a\x45XCLUDED_PARENT_FIELD_TYPE\x10\x10\x12\x12\n\x0eINVALID_STATUS\x10\x11\x12&\n\"YOUTUBE_VIDEO_DURATION_NOT_DEFINED\x10\x12\x12-\n)CANNOT_CREATE_AUTOMATICALLY_CREATED_LINKS\x10\x13\x12.\n*CANNOT_LINK_TO_AUTOMATICALLY_CREATED_ASSET\x10\x14\x12#\n\x1f\x43\x41NNOT_MODIFY_ASSET_LINK_SOURCE\x10\x15\x12\x39\n5CANNOT_LINK_LOCATION_LEAD_FORM_WITHOUT_LOCATION_ASSET\x10\x16\x12\x19\n\x15\x43USTOMER_NOT_VERIFIED\x10\x17\x12\x1e\n\x1aUNSUPPORTED_CALL_TO_ACTION\x10\x18\x42\xf3\x01\n#com.google.ads.googleads.v16.errorsB\x13\x41ssetLinkErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetLinkErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetLinkErrorEnum").msgclass + AssetLinkErrorEnum::AssetLinkError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetLinkErrorEnum.AssetLinkError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_set_asset_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_set_asset_error_pb.rb new file mode 100644 index 000000000..23045dc2f --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_set_asset_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_set_asset_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n;google/ads/googleads/v16/errors/asset_set_asset_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xc0\x01\n\x16\x41ssetSetAssetErrorEnum\"\xa5\x01\n\x12\x41ssetSetAssetError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x16\n\x12INVALID_ASSET_TYPE\x10\x02\x12\x1a\n\x16INVALID_ASSET_SET_TYPE\x10\x03\x12\x1a\n\x16\x44UPLICATE_EXTERNAL_KEY\x10\x04\x12!\n\x1dPARENT_LINKAGE_DOES_NOT_EXIST\x10\x05\x42\xf7\x01\n#com.google.ads.googleads.v16.errorsB\x17\x41ssetSetAssetErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetSetAssetErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetSetAssetErrorEnum").msgclass + AssetSetAssetErrorEnum::AssetSetAssetError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetSetAssetErrorEnum.AssetSetAssetError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_set_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_set_error_pb.rb new file mode 100644 index 000000000..4b42f32aa --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_set_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_set_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n5google/ads/googleads/v16/errors/asset_set_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xef\x03\n\x11\x41ssetSetErrorEnum\"\xd9\x03\n\rAssetSetError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1c\n\x18\x44UPLICATE_ASSET_SET_NAME\x10\x02\x12!\n\x1dINVALID_PARENT_ASSET_SET_TYPE\x10\x03\x12\x37\n3ASSET_SET_SOURCE_INCOMPATIBLE_WITH_PARENT_ASSET_SET\x10\x04\x12/\n+ASSET_SET_TYPE_CANNOT_BE_LINKED_TO_CUSTOMER\x10\x05\x12\x15\n\x11INVALID_CHAIN_IDS\x10\x06\x12>\n:LOCATION_SYNC_ASSET_SET_DOES_NOT_SUPPORT_RELATIONSHIP_TYPE\x10\x07\x12\x34\n0NOT_UNIQUE_ENABLED_LOCATION_SYNC_TYPED_ASSET_SET\x10\x08\x12\x15\n\x11INVALID_PLACE_IDS\x10\t\x12\x16\n\x12OAUTH_INFO_INVALID\x10\x0b\x12\x16\n\x12OAUTH_INFO_MISSING\x10\x0c\x12+\n\'CANNOT_DELETE_AS_ENABLED_LINKAGES_EXIST\x10\nB\xf2\x01\n#com.google.ads.googleads.v16.errorsB\x12\x41ssetSetErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetSetErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetSetErrorEnum").msgclass + AssetSetErrorEnum::AssetSetError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetSetErrorEnum.AssetSetError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/asset_set_link_error_pb.rb b/lib/google/ads/google_ads/v16/errors/asset_set_link_error_pb.rb new file mode 100644 index 000000000..906b0d112 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/asset_set_link_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/asset_set_link_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/ads/googleads/v16/errors/asset_set_link_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x87\x02\n\x15\x41ssetSetLinkErrorEnum\"\xed\x01\n\x11\x41ssetSetLinkError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12)\n%INCOMPATIBLE_ADVERTISING_CHANNEL_TYPE\x10\x02\x12\x17\n\x13\x44UPLICATE_FEED_LINK\x10\x03\x12\x32\n.INCOMPATIBLE_ASSET_SET_TYPE_WITH_CAMPAIGN_TYPE\x10\x04\x12\x1c\n\x18\x44UPLICATE_ASSET_SET_LINK\x10\x05\x12$\n ASSET_SET_LINK_CANNOT_BE_REMOVED\x10\x06\x42\xf6\x01\n#com.google.ads.googleads.v16.errorsB\x16\x41ssetSetLinkErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AssetSetLinkErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetSetLinkErrorEnum").msgclass + AssetSetLinkErrorEnum::AssetSetLinkError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AssetSetLinkErrorEnum.AssetSetLinkError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/audience_error_pb.rb b/lib/google/ads/google_ads/v16/errors/audience_error_pb.rb new file mode 100644 index 000000000..2f5a90690 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/audience_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/audience_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n4google/ads/googleads/v16/errors/audience_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xf7\x02\n\x11\x41udienceErrorEnum\"\xe1\x02\n\rAudienceError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x17\n\x13NAME_ALREADY_IN_USE\x10\x02\x12\x15\n\x11\x44IMENSION_INVALID\x10\x03\x12\x1e\n\x1a\x41UDIENCE_SEGMENT_NOT_FOUND\x10\x04\x12\'\n#AUDIENCE_SEGMENT_TYPE_NOT_SUPPORTED\x10\x05\x12\x1e\n\x1a\x44UPLICATE_AUDIENCE_SEGMENT\x10\x06\x12\x15\n\x11TOO_MANY_SEGMENTS\x10\x07\x12$\n TOO_MANY_DIMENSIONS_OF_SAME_TYPE\x10\x08\x12\n\n\x06IN_USE\x10\t\x12\x1a\n\x16MISSING_ASSET_GROUP_ID\x10\n\x12\x34\n0CANNOT_CHANGE_FROM_CUSTOMER_TO_ASSET_GROUP_SCOPE\x10\x0b\x42\xf2\x01\n#com.google.ads.googleads.v16.errorsB\x12\x41udienceErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AudienceErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AudienceErrorEnum").msgclass + AudienceErrorEnum::AudienceError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AudienceErrorEnum.AudienceError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/audience_insights_error_pb.rb b/lib/google/ads/google_ads/v16/errors/audience_insights_error_pb.rb new file mode 100644 index 000000000..a5ec0e952 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/audience_insights_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/audience_insights_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n=google/ads/googleads/v16/errors/audience_insights_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x8f\x01\n\x19\x41udienceInsightsErrorEnum\"r\n\x15\x41udienceInsightsError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12;\n7DIMENSION_INCOMPATIBLE_WITH_TOPIC_AUDIENCE_COMBINATIONS\x10\x02\x42\xfa\x01\n#com.google.ads.googleads.v16.errorsB\x1a\x41udienceInsightsErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AudienceInsightsErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AudienceInsightsErrorEnum").msgclass + AudienceInsightsErrorEnum::AudienceInsightsError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AudienceInsightsErrorEnum.AudienceInsightsError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/authentication_error_pb.rb b/lib/google/ads/google_ads/v16/errors/authentication_error_pb.rb new file mode 100644 index 000000000..57e6e1999 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/authentication_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/authentication_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/ads/googleads/v16/errors/authentication_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xde\x05\n\x17\x41uthenticationErrorEnum\"\xc2\x05\n\x13\x41uthenticationError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x18\n\x14\x41UTHENTICATION_ERROR\x10\x02\x12\x1e\n\x1a\x43LIENT_CUSTOMER_ID_INVALID\x10\x05\x12\x16\n\x12\x43USTOMER_NOT_FOUND\x10\x08\x12\x1a\n\x16GOOGLE_ACCOUNT_DELETED\x10\t\x12!\n\x1dGOOGLE_ACCOUNT_COOKIE_INVALID\x10\n\x12(\n$GOOGLE_ACCOUNT_AUTHENTICATION_FAILED\x10\x19\x12-\n)GOOGLE_ACCOUNT_USER_AND_ADS_USER_MISMATCH\x10\x0c\x12\x19\n\x15LOGIN_COOKIE_REQUIRED\x10\r\x12\x10\n\x0cNOT_ADS_USER\x10\x0e\x12\x17\n\x13OAUTH_TOKEN_INVALID\x10\x0f\x12\x17\n\x13OAUTH_TOKEN_EXPIRED\x10\x10\x12\x18\n\x14OAUTH_TOKEN_DISABLED\x10\x11\x12\x17\n\x13OAUTH_TOKEN_REVOKED\x10\x12\x12\x1e\n\x1aOAUTH_TOKEN_HEADER_INVALID\x10\x13\x12\x18\n\x14LOGIN_COOKIE_INVALID\x10\x14\x12\x13\n\x0fUSER_ID_INVALID\x10\x16\x12&\n\"TWO_STEP_VERIFICATION_NOT_ENROLLED\x10\x17\x12$\n ADVANCED_PROTECTION_NOT_ENROLLED\x10\x18\x12\x1f\n\x1bORGANIZATION_NOT_RECOGNIZED\x10\x1a\x12\x1d\n\x19ORGANIZATION_NOT_APPROVED\x10\x1b\x12\x34\n0ORGANIZATION_NOT_ASSOCIATED_WITH_DEVELOPER_TOKEN\x10\x1c\x42\xf8\x01\n#com.google.ads.googleads.v16.errorsB\x18\x41uthenticationErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AuthenticationErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AuthenticationErrorEnum").msgclass + AuthenticationErrorEnum::AuthenticationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AuthenticationErrorEnum.AuthenticationError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/authorization_error_pb.rb b/lib/google/ads/google_ads/v16/errors/authorization_error_pb.rb new file mode 100644 index 000000000..f05d0288f --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/authorization_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/authorization_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n9google/ads/googleads/v16/errors/authorization_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xce\x04\n\x16\x41uthorizationErrorEnum\"\xb3\x04\n\x12\x41uthorizationError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1a\n\x16USER_PERMISSION_DENIED\x10\x02\x12$\n DEVELOPER_TOKEN_NOT_ON_ALLOWLIST\x10\r\x12\x1e\n\x1a\x44\x45VELOPER_TOKEN_PROHIBITED\x10\x04\x12\x14\n\x10PROJECT_DISABLED\x10\x05\x12\x17\n\x13\x41UTHORIZATION_ERROR\x10\x06\x12\x18\n\x14\x41\x43TION_NOT_PERMITTED\x10\x07\x12\x15\n\x11INCOMPLETE_SIGNUP\x10\x08\x12\x18\n\x14\x43USTOMER_NOT_ENABLED\x10\x18\x12\x0f\n\x0bMISSING_TOS\x10\t\x12 \n\x1c\x44\x45VELOPER_TOKEN_NOT_APPROVED\x10\n\x12=\n9INVALID_LOGIN_CUSTOMER_ID_SERVING_CUSTOMER_ID_COMBINATION\x10\x0b\x12\x19\n\x15SERVICE_ACCESS_DENIED\x10\x0c\x12\"\n\x1e\x41\x43\x43\x45SS_DENIED_FOR_ACCOUNT_TYPE\x10\x19\x12\x18\n\x14METRIC_ACCESS_DENIED\x10\x1a\x12(\n$CLOUD_PROJECT_NOT_UNDER_ORGANIZATION\x10\x1b\x12.\n*ACTION_NOT_PERMITTED_FOR_SUSPENDED_ACCOUNT\x10\x1c\x42\xf7\x01\n#com.google.ads.googleads.v16.errorsB\x17\x41uthorizationErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + AuthorizationErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AuthorizationErrorEnum").msgclass + AuthorizationErrorEnum::AuthorizationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.AuthorizationErrorEnum.AuthorizationError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/batch_job_error_pb.rb b/lib/google/ads/google_ads/v16/errors/batch_job_error_pb.rb new file mode 100644 index 000000000..b38d1998f --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/batch_job_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/batch_job_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n5google/ads/googleads/v16/errors/batch_job_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x8d\x02\n\x11\x42\x61tchJobErrorEnum\"\xf7\x01\n\rBatchJobError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12.\n*CANNOT_MODIFY_JOB_AFTER_JOB_STARTS_RUNNING\x10\x02\x12\x14\n\x10\x45MPTY_OPERATIONS\x10\x03\x12\x1a\n\x16INVALID_SEQUENCE_TOKEN\x10\x04\x12\x15\n\x11RESULTS_NOT_READY\x10\x05\x12\x15\n\x11INVALID_PAGE_SIZE\x10\x06\x12\x1f\n\x1b\x43\x41N_ONLY_REMOVE_PENDING_JOB\x10\x07\x12\x17\n\x13\x43\x41NNOT_LIST_RESULTS\x10\x08\x42\xf2\x01\n#com.google.ads.googleads.v16.errorsB\x12\x42\x61tchJobErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + BatchJobErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.BatchJobErrorEnum").msgclass + BatchJobErrorEnum::BatchJobError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.BatchJobErrorEnum.BatchJobError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/bidding_error_pb.rb b/lib/google/ads/google_ads/v16/errors/bidding_error_pb.rb new file mode 100644 index 000000000..04fada2fe --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/bidding_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/bidding_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n3google/ads/googleads/v16/errors/bidding_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xd3\t\n\x10\x42iddingErrorEnum\"\xbe\t\n\x0c\x42iddingError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12+\n\'BIDDING_STRATEGY_TRANSITION_NOT_ALLOWED\x10\x02\x12.\n*CANNOT_ATTACH_BIDDING_STRATEGY_TO_CAMPAIGN\x10\x07\x12+\n\'INVALID_ANONYMOUS_BIDDING_STRATEGY_TYPE\x10\n\x12!\n\x1dINVALID_BIDDING_STRATEGY_TYPE\x10\x0e\x12\x0f\n\x0bINVALID_BID\x10\x11\x12\x33\n/BIDDING_STRATEGY_NOT_AVAILABLE_FOR_ACCOUNT_TYPE\x10\x12\x12\x30\n,CANNOT_CREATE_CAMPAIGN_WITH_BIDDING_STRATEGY\x10\x15\x12O\nKCANNOT_TARGET_CONTENT_NETWORK_ONLY_WITH_CAMPAIGN_LEVEL_POP_BIDDING_STRATEGY\x10\x17\x12\x33\n/BIDDING_STRATEGY_NOT_SUPPORTED_WITH_AD_SCHEDULE\x10\x18\x12\x31\n-PAY_PER_CONVERSION_NOT_AVAILABLE_FOR_CUSTOMER\x10\x19\x12\x32\n.PAY_PER_CONVERSION_NOT_ALLOWED_WITH_TARGET_CPA\x10\x1a\x12:\n6BIDDING_STRATEGY_NOT_ALLOWED_FOR_SEARCH_ONLY_CAMPAIGNS\x10\x1b\x12;\n7BIDDING_STRATEGY_NOT_SUPPORTED_IN_DRAFTS_OR_EXPERIMENTS\x10\x1c\x12I\nEBIDDING_STRATEGY_TYPE_DOES_NOT_SUPPORT_PRODUCT_TYPE_ADGROUP_CRITERION\x10\x1d\x12\x11\n\rBID_TOO_SMALL\x10\x1e\x12\x0f\n\x0b\x42ID_TOO_BIG\x10\x1f\x12\"\n\x1e\x42ID_TOO_MANY_FRACTIONAL_DIGITS\x10 \x12\x17\n\x13INVALID_DOMAIN_NAME\x10!\x12$\n NOT_COMPATIBLE_WITH_PAYMENT_MODE\x10\"\x12\x39\n5BIDDING_STRATEGY_TYPE_INCOMPATIBLE_WITH_SHARED_BUDGET\x10%\x12/\n+BIDDING_STRATEGY_AND_BUDGET_MUST_BE_ALIGNED\x10&\x12O\nKBIDDING_STRATEGY_AND_BUDGET_MUST_BE_ATTACHED_TO_THE_SAME_CAMPAIGNS_TO_ALIGN\x10\'\x12\x38\n4BIDDING_STRATEGY_AND_BUDGET_MUST_BE_REMOVED_TOGETHER\x10(\x12<\n8CPC_BID_FLOOR_MICROS_GREATER_THAN_CPC_BID_CEILING_MICROS\x10)B\xf1\x01\n#com.google.ads.googleads.v16.errorsB\x11\x42iddingErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + BiddingErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.BiddingErrorEnum").msgclass + BiddingErrorEnum::BiddingError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.BiddingErrorEnum.BiddingError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/bidding_strategy_error_pb.rb b/lib/google/ads/google_ads/v16/errors/bidding_strategy_error_pb.rb new file mode 100644 index 000000000..369676689 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/bidding_strategy_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/bidding_strategy_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n\n:CANNOT_SET_BOTH_TRACKING_URL_TEMPLATE_AND_TRACKING_SETTING\x10\x11\x12 \n\x1cMAX_IMPRESSIONS_NOT_IN_RANGE\x10\x12\x12\x1b\n\x17TIME_UNIT_NOT_SUPPORTED\x10\x13\x12\x31\n-INVALID_OPERATION_IF_SERVING_STATUS_HAS_ENDED\x10\x14\x12\x1b\n\x17\x42UDGET_CANNOT_BE_SHARED\x10\x15\x12%\n!CAMPAIGN_CANNOT_USE_SHARED_BUDGET\x10\x16\x12\x30\n,CANNOT_CHANGE_BUDGET_ON_CAMPAIGN_WITH_TRIALS\x10\x17\x12!\n\x1d\x43\x41MPAIGN_LABEL_DOES_NOT_EXIST\x10\x18\x12!\n\x1d\x43\x41MPAIGN_LABEL_ALREADY_EXISTS\x10\x19\x12\x1c\n\x18MISSING_SHOPPING_SETTING\x10\x1a\x12\"\n\x1eINVALID_SHOPPING_SALES_COUNTRY\x10\x1b\x12;\n7ADVERTISING_CHANNEL_TYPE_NOT_AVAILABLE_FOR_ACCOUNT_TYPE\x10\x1f\x12(\n$INVALID_ADVERTISING_CHANNEL_SUB_TYPE\x10 \x12,\n(AT_LEAST_ONE_CONVERSION_MUST_BE_SELECTED\x10!\x12\x1f\n\x1b\x43\x41NNOT_SET_AD_ROTATION_MODE\x10\"\x12/\n+CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED\x10#\x12\x1b\n\x17\x43\x41NNOT_SET_DATE_TO_PAST\x10$\x12\x1f\n\x1bMISSING_HOTEL_CUSTOMER_LINK\x10%\x12\x1f\n\x1bINVALID_HOTEL_CUSTOMER_LINK\x10&\x12\x19\n\x15MISSING_HOTEL_SETTING\x10\'\x12\x42\n>CANNOT_USE_SHARED_CAMPAIGN_BUDGET_WHILE_PART_OF_CAMPAIGN_GROUP\x10(\x12\x11\n\rAPP_NOT_FOUND\x10)\x12\x39\n5SHOPPING_ENABLE_LOCAL_NOT_SUPPORTED_FOR_CAMPAIGN_TYPE\x10*\x12\x33\n/MERCHANT_NOT_ALLOWED_FOR_COMPARISON_LISTING_ADS\x10+\x12#\n\x1fINSUFFICIENT_APP_INSTALLS_COUNT\x10,\x12\x1a\n\x16SENSITIVE_CATEGORY_APP\x10-\x12\x1a\n\x16HEC_AGREEMENT_REQUIRED\x10.\x12<\n8NOT_COMPATIBLE_WITH_VIEW_THROUGH_CONVERSION_OPTIMIZATION\x10\x31\x12,\n(INVALID_EXCLUDED_PARENT_ASSET_FIELD_TYPE\x10\x30\x12:\n6CANNOT_CREATE_APP_PRE_REGISTRATION_FOR_NON_ANDROID_APP\x10\x32\x12=\n9APP_NOT_AVAILABLE_TO_CREATE_APP_PRE_REGISTRATION_CAMPAIGN\x10\x33\x12\x1c\n\x18INCOMPATIBLE_BUDGET_TYPE\x10\x34\x12)\n%LOCAL_SERVICES_DUPLICATE_CATEGORY_BID\x10\x35\x12\'\n#LOCAL_SERVICES_INVALID_CATEGORY_BID\x10\x36\x12\'\n#LOCAL_SERVICES_MISSING_CATEGORY_BID\x10\x37\x12\x19\n\x15INVALID_STATUS_CHANGE\x10\x39\x12 \n\x1cMISSING_TRAVEL_CUSTOMER_LINK\x10:\x12 \n\x1cINVALID_TRAVEL_CUSTOMER_LINK\x10;\x12*\n&INVALID_EXCLUDED_PARENT_ASSET_SET_TYPE\x10>\x12,\n(ASSET_SET_NOT_A_HOTEL_PROPERTY_ASSET_SET\x10?\x12\x46\nBHOTEL_PROPERTY_ASSET_SET_ONLY_FOR_PERFORMANCE_MAX_FOR_TRAVEL_GOALS\x10@\x12 \n\x1c\x41VERAGE_DAILY_SPEND_TOO_HIGH\x10\x41\x12+\n\'CANNOT_ATTACH_TO_REMOVED_CAMPAIGN_GROUP\x10\x42\x12%\n!CANNOT_ATTACH_TO_BIDDING_STRATEGY\x10\x43\x12\x1f\n\x1b\x43\x41NNOT_CHANGE_BUDGET_PERIOD\x10\x44\x12\x1a\n\x16NOT_ENOUGH_CONVERSIONS\x10G\x12.\n*CANNOT_SET_MORE_THAN_ONE_CONVERSION_ACTION\x10H\x12#\n\x1fNOT_COMPATIBLE_WITH_BUDGET_TYPE\x10I\x12\x30\n,NOT_COMPATIBLE_WITH_UPLOAD_CLICKS_CONVERSION\x10J\x12.\n*APP_ID_MUST_MATCH_CONVERSION_ACTION_APP_ID\x10L\x12\x38\n4CONVERSION_ACTION_WITH_DOWNLOAD_CATEGORY_NOT_ALLOWED\x10M\x12\x35\n1CONVERSION_ACTION_WITH_DOWNLOAD_CATEGORY_REQUIRED\x10N\x12#\n\x1f\x43ONVERSION_TRACKING_NOT_ENABLED\x10O\x12-\n)NOT_COMPATIBLE_WITH_BIDDING_STRATEGY_TYPE\x10P\x12\x36\n2NOT_COMPATIBLE_WITH_GOOGLE_ATTRIBUTION_CONVERSIONS\x10Q\x12\x1b\n\x17\x43ONVERSION_LAG_TOO_HIGH\x10R\x12\"\n\x1eNOT_LINKED_ADVERTISING_PARTNER\x10S\x12-\n)INVALID_NUMBER_OF_ADVERTISING_PARTNER_IDS\x10T\x12\x31\n-CANNOT_TARGET_DISPLAY_NETWORK_WITHOUT_YOUTUBE\x10U\x12\x36\n2CANNOT_LINK_TO_COMPARISON_SHOPPING_SERVICE_ACCOUNT\x10V\x12I\nECANNOT_TARGET_NETWORK_FOR_COMPARISON_SHOPPING_SERVICE_LINKED_ACCOUNTS\x10W\x12:\n6CANNOT_MODIFY_TEXT_ASSET_AUTOMATION_WITH_ENABLED_TRIAL\x10XB\xf2\x01\n#com.google.ads.googleads.v16.errorsB\x12\x43\x61mpaignErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CampaignErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignErrorEnum").msgclass + CampaignErrorEnum::CampaignError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignErrorEnum.CampaignError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/campaign_experiment_error_pb.rb b/lib/google/ads/google_ads/v16/errors/campaign_experiment_error_pb.rb new file mode 100644 index 000000000..1fa02b2ec --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/campaign_experiment_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/campaign_experiment_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n?google/ads/googleads/v16/errors/campaign_experiment_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x80\x04\n\x1b\x43\x61mpaignExperimentErrorEnum\"\xe0\x03\n\x17\x43\x61mpaignExperimentError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x12\n\x0e\x44UPLICATE_NAME\x10\x02\x12\x16\n\x12INVALID_TRANSITION\x10\x03\x12/\n+CANNOT_CREATE_EXPERIMENT_WITH_SHARED_BUDGET\x10\x04\x12\x36\n2CANNOT_CREATE_EXPERIMENT_FOR_REMOVED_BASE_CAMPAIGN\x10\x05\x12\x33\n/CANNOT_CREATE_EXPERIMENT_FOR_NON_PROPOSED_DRAFT\x10\x06\x12%\n!CUSTOMER_CANNOT_CREATE_EXPERIMENT\x10\x07\x12%\n!CAMPAIGN_CANNOT_CREATE_EXPERIMENT\x10\x08\x12)\n%EXPERIMENT_DURATIONS_MUST_NOT_OVERLAP\x10\t\x12\x38\n4EXPERIMENT_DURATION_MUST_BE_WITHIN_CAMPAIGN_DURATION\x10\n\x12*\n&CANNOT_MUTATE_EXPERIMENT_DUE_TO_STATUS\x10\x0b\x42\xfc\x01\n#com.google.ads.googleads.v16.errorsB\x1c\x43\x61mpaignExperimentErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CampaignExperimentErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignExperimentErrorEnum").msgclass + CampaignExperimentErrorEnum::CampaignExperimentError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignExperimentErrorEnum.CampaignExperimentError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/campaign_feed_error_pb.rb b/lib/google/ads/google_ads/v16/errors/campaign_feed_error_pb.rb new file mode 100644 index 000000000..46d71463e --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/campaign_feed_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/campaign_feed_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n9google/ads/googleads/v16/errors/campaign_feed_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x8c\x03\n\x15\x43\x61mpaignFeedErrorEnum\"\xf2\x02\n\x11\x43\x61mpaignFeedError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12,\n(FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE\x10\x02\x12\"\n\x1e\x43\x41NNOT_CREATE_FOR_REMOVED_FEED\x10\x04\x12\x30\n,CANNOT_CREATE_ALREADY_EXISTING_CAMPAIGN_FEED\x10\x05\x12\'\n#CANNOT_MODIFY_REMOVED_CAMPAIGN_FEED\x10\x06\x12\x1c\n\x18INVALID_PLACEHOLDER_TYPE\x10\x07\x12,\n(MISSING_FEEDMAPPING_FOR_PLACEHOLDER_TYPE\x10\x08\x12&\n\"NO_EXISTING_LOCATION_CUSTOMER_FEED\x10\t\x12\x1e\n\x1aLEGACY_FEED_TYPE_READ_ONLY\x10\nB\xf6\x01\n#com.google.ads.googleads.v16.errorsB\x16\x43\x61mpaignFeedErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CampaignFeedErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignFeedErrorEnum").msgclass + CampaignFeedErrorEnum::CampaignFeedError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignFeedErrorEnum.CampaignFeedError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/campaign_lifecycle_goal_error_pb.rb b/lib/google/ads/google_ads/v16/errors/campaign_lifecycle_goal_error_pb.rb new file mode 100644 index 000000000..7140feeb2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/campaign_lifecycle_goal_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/campaign_lifecycle_goal_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/errors/campaign_lifecycle_goal_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xb5\x04\n\x1e\x43\x61mpaignLifecycleGoalErrorEnum\"\x92\x04\n\x1a\x43\x61mpaignLifecycleGoalError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x14\n\x10\x43\x41MPAIGN_MISSING\x10\x02\x12\x14\n\x10INVALID_CAMPAIGN\x10\x03\x12\x32\n.CUSTOMER_ACQUISITION_INVALID_OPTIMIZATION_MODE\x10\x04\x12!\n\x1dINCOMPATIBLE_BIDDING_STRATEGY\x10\x05\x12\x19\n\x15MISSING_PURCHASE_GOAL\x10\x06\x12\x34\n0CUSTOMER_ACQUISITION_INVALID_HIGH_LIFETIME_VALUE\x10\x07\x12\x32\n.CUSTOMER_ACQUISITION_UNSUPPORTED_CAMPAIGN_TYPE\x10\x08\x12&\n\"CUSTOMER_ACQUISITION_INVALID_VALUE\x10\t\x12&\n\"CUSTOMER_ACQUISITION_VALUE_MISSING\x10\n\x12=\n9CUSTOMER_ACQUISITION_MISSING_EXISTING_CUSTOMER_DEFINITION\x10\x0b\x12?\n;CUSTOMER_ACQUISITION_MISSING_HIGH_VALUE_CUSTOMER_DEFINITION\x10\x0c\x42\xff\x01\n#com.google.ads.googleads.v16.errorsB\x1f\x43\x61mpaignLifecycleGoalErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CampaignLifecycleGoalErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignLifecycleGoalErrorEnum").msgclass + CampaignLifecycleGoalErrorEnum::CampaignLifecycleGoalError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignLifecycleGoalErrorEnum.CampaignLifecycleGoalError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/campaign_shared_set_error_pb.rb b/lib/google/ads/google_ads/v16/errors/campaign_shared_set_error_pb.rb new file mode 100644 index 000000000..e73c871b1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/campaign_shared_set_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/campaign_shared_set_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n?google/ads/googleads/v16/errors/campaign_shared_set_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"r\n\x1a\x43\x61mpaignSharedSetErrorEnum\"T\n\x16\x43\x61mpaignSharedSetError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1c\n\x18SHARED_SET_ACCESS_DENIED\x10\x02\x42\xfb\x01\n#com.google.ads.googleads.v16.errorsB\x1b\x43\x61mpaignSharedSetErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CampaignSharedSetErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignSharedSetErrorEnum").msgclass + CampaignSharedSetErrorEnum::CampaignSharedSetError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CampaignSharedSetErrorEnum.CampaignSharedSetError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/change_event_error_pb.rb b/lib/google/ads/google_ads/v16/errors/change_event_error_pb.rb new file mode 100644 index 000000000..c645a29c4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/change_event_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/change_event_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/ads/googleads/v16/errors/change_event_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xd4\x01\n\x14\x43hangeEventErrorEnum\"\xbb\x01\n\x10\x43hangeEventError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x16\n\x12START_DATE_TOO_OLD\x10\x02\x12\x1e\n\x1a\x43HANGE_DATE_RANGE_INFINITE\x10\x03\x12\x1e\n\x1a\x43HANGE_DATE_RANGE_NEGATIVE\x10\x04\x12\x17\n\x13LIMIT_NOT_SPECIFIED\x10\x05\x12\x18\n\x14INVALID_LIMIT_CLAUSE\x10\x06\x42\xf5\x01\n#com.google.ads.googleads.v16.errorsB\x15\x43hangeEventErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ChangeEventErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ChangeEventErrorEnum").msgclass + ChangeEventErrorEnum::ChangeEventError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ChangeEventErrorEnum.ChangeEventError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/change_status_error_pb.rb b/lib/google/ads/google_ads/v16/errors/change_status_error_pb.rb new file mode 100644 index 000000000..f3f75b75d --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/change_status_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/change_status_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n9google/ads/googleads/v16/errors/change_status_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xd6\x01\n\x15\x43hangeStatusErrorEnum\"\xbc\x01\n\x11\x43hangeStatusError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x16\n\x12START_DATE_TOO_OLD\x10\x03\x12\x1e\n\x1a\x43HANGE_DATE_RANGE_INFINITE\x10\x04\x12\x1e\n\x1a\x43HANGE_DATE_RANGE_NEGATIVE\x10\x05\x12\x17\n\x13LIMIT_NOT_SPECIFIED\x10\x06\x12\x18\n\x14INVALID_LIMIT_CLAUSE\x10\x07\x42\xf6\x01\n#com.google.ads.googleads.v16.errorsB\x16\x43hangeStatusErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ChangeStatusErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ChangeStatusErrorEnum").msgclass + ChangeStatusErrorEnum::ChangeStatusError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ChangeStatusErrorEnum.ChangeStatusError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/collection_size_error_pb.rb b/lib/google/ads/google_ads/v16/errors/collection_size_error_pb.rb new file mode 100644 index 000000000..fd62f4678 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/collection_size_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/collection_size_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n;google/ads/googleads/v16/errors/collection_size_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"i\n\x17\x43ollectionSizeErrorEnum\"N\n\x13\x43ollectionSizeError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07TOO_FEW\x10\x02\x12\x0c\n\x08TOO_MANY\x10\x03\x42\xf8\x01\n#com.google.ads.googleads.v16.errorsB\x18\x43ollectionSizeErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CollectionSizeErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CollectionSizeErrorEnum").msgclass + CollectionSizeErrorEnum::CollectionSizeError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CollectionSizeErrorEnum.CollectionSizeError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/context_error_pb.rb b/lib/google/ads/google_ads/v16/errors/context_error_pb.rb new file mode 100644 index 000000000..d239792fd --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/context_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/context_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n3google/ads/googleads/v16/errors/context_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x9c\x01\n\x10\x43ontextErrorEnum\"\x87\x01\n\x0c\x43ontextError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\'\n#OPERATION_NOT_PERMITTED_FOR_CONTEXT\x10\x02\x12\x30\n,OPERATION_NOT_PERMITTED_FOR_REMOVED_RESOURCE\x10\x03\x42\xf1\x01\n#com.google.ads.googleads.v16.errorsB\x11\x43ontextErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ContextErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ContextErrorEnum").msgclass + ContextErrorEnum::ContextError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ContextErrorEnum.ContextError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/conversion_action_error_pb.rb b/lib/google/ads/google_ads/v16/errors/conversion_action_error_pb.rb new file mode 100644 index 000000000..77951d28b --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/conversion_action_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/conversion_action_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n=google/ads/googleads/v16/errors/conversion_action_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xd3\x03\n\x19\x43onversionActionErrorEnum\"\xb5\x03\n\x15\x43onversionActionError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x12\n\x0e\x44UPLICATE_NAME\x10\x02\x12\x14\n\x10\x44UPLICATE_APP_ID\x10\x03\x12\x37\n3TWO_CONVERSION_ACTIONS_BIDDING_ON_SAME_APP_DOWNLOAD\x10\x04\x12\x31\n-BIDDING_ON_SAME_APP_DOWNLOAD_AS_GLOBAL_ACTION\x10\x05\x12)\n%DATA_DRIVEN_MODEL_WAS_NEVER_GENERATED\x10\x06\x12\x1d\n\x19\x44\x41TA_DRIVEN_MODEL_EXPIRED\x10\x07\x12\x1b\n\x17\x44\x41TA_DRIVEN_MODEL_STALE\x10\x08\x12\x1d\n\x19\x44\x41TA_DRIVEN_MODEL_UNKNOWN\x10\t\x12\x1a\n\x16\x43REATION_NOT_SUPPORTED\x10\n\x12\x18\n\x14UPDATE_NOT_SUPPORTED\x10\x0b\x12,\n(CANNOT_SET_RULE_BASED_ATTRIBUTION_MODELS\x10\x0c\x42\xfa\x01\n#com.google.ads.googleads.v16.errorsB\x1a\x43onversionActionErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ConversionActionErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ConversionActionErrorEnum").msgclass + ConversionActionErrorEnum::ConversionActionError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ConversionActionErrorEnum.ConversionActionError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/conversion_adjustment_upload_error_pb.rb b/lib/google/ads/google_ads/v16/errors/conversion_adjustment_upload_error_pb.rb new file mode 100644 index 000000000..108885f05 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/conversion_adjustment_upload_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/conversion_adjustment_upload_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nHgoogle/ads/googleads/v16/errors/conversion_adjustment_upload_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xf0\x07\n#ConversionAdjustmentUploadErrorEnum\"\xc8\x07\n\x1f\x43onversionAdjustmentUploadError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12 \n\x1cTOO_RECENT_CONVERSION_ACTION\x10\x02\x12 \n\x1c\x43ONVERSION_ALREADY_RETRACTED\x10\x04\x12\x18\n\x14\x43ONVERSION_NOT_FOUND\x10\x05\x12\x16\n\x12\x43ONVERSION_EXPIRED\x10\x06\x12\"\n\x1e\x41\x44JUSTMENT_PRECEDES_CONVERSION\x10\x07\x12!\n\x1dMORE_RECENT_RESTATEMENT_FOUND\x10\x08\x12\x19\n\x15TOO_RECENT_CONVERSION\x10\t\x12N\nJCANNOT_RESTATE_CONVERSION_ACTION_THAT_ALWAYS_USES_DEFAULT_CONVERSION_VALUE\x10\n\x12#\n\x1fTOO_MANY_ADJUSTMENTS_IN_REQUEST\x10\x0b\x12\x18\n\x14TOO_MANY_ADJUSTMENTS\x10\x0c\x12\x1e\n\x1aRESTATEMENT_ALREADY_EXISTS\x10\r\x12#\n\x1f\x44UPLICATE_ADJUSTMENT_IN_REQUEST\x10\x0e\x12-\n)CUSTOMER_NOT_ACCEPTED_CUSTOMER_DATA_TERMS\x10\x0f\x12\x32\n.CONVERSION_ACTION_NOT_ELIGIBLE_FOR_ENHANCEMENT\x10\x10\x12\x1b\n\x17INVALID_USER_IDENTIFIER\x10\x11\x12\x1f\n\x1bUNSUPPORTED_USER_IDENTIFIER\x10\x12\x12.\n*GCLID_DATE_TIME_PAIR_AND_ORDER_ID_BOTH_SET\x10\x14\x12\x1f\n\x1b\x43ONVERSION_ALREADY_ENHANCED\x10\x15\x12$\n DUPLICATE_ENHANCEMENT_IN_REQUEST\x10\x16\x12.\n*CUSTOMER_DATA_POLICY_PROHIBITS_ENHANCEMENT\x10\x17\x12 \n\x1cMISSING_ORDER_ID_FOR_WEBPAGE\x10\x18\x12\x19\n\x15ORDER_ID_CONTAINS_PII\x10\x19\x12\x12\n\x0eINVALID_JOB_ID\x10\x1a\x12\x1e\n\x1aNO_CONVERSION_ACTION_FOUND\x10\x1b\x12\"\n\x1eINVALID_CONVERSION_ACTION_TYPE\x10\x1c\x42\x84\x02\n#com.google.ads.googleads.v16.errorsB$ConversionAdjustmentUploadErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ConversionAdjustmentUploadErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ConversionAdjustmentUploadErrorEnum").msgclass + ConversionAdjustmentUploadErrorEnum::ConversionAdjustmentUploadError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ConversionAdjustmentUploadErrorEnum.ConversionAdjustmentUploadError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/conversion_custom_variable_error_pb.rb b/lib/google/ads/google_ads/v16/errors/conversion_custom_variable_error_pb.rb new file mode 100644 index 000000000..8ce838f46 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/conversion_custom_variable_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/conversion_custom_variable_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/errors/conversion_custom_variable_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x9b\x01\n!ConversionCustomVariableErrorEnum\"v\n\x1d\x43onversionCustomVariableError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x12\n\x0e\x44UPLICATE_NAME\x10\x02\x12\x11\n\rDUPLICATE_TAG\x10\x03\x12\x10\n\x0cRESERVED_TAG\x10\x04\x42\x82\x02\n#com.google.ads.googleads.v16.errorsB\"ConversionCustomVariableErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ConversionCustomVariableErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ConversionCustomVariableErrorEnum").msgclass + ConversionCustomVariableErrorEnum::ConversionCustomVariableError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ConversionCustomVariableErrorEnum.ConversionCustomVariableError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/conversion_goal_campaign_config_error_pb.rb b/lib/google/ads/google_ads/v16/errors/conversion_goal_campaign_config_error_pb.rb new file mode 100644 index 000000000..fdf60b526 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/conversion_goal_campaign_config_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/conversion_goal_campaign_config_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nKgoogle/ads/googleads/v16/errors/conversion_goal_campaign_config_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xad\x03\n%ConversionGoalCampaignConfigErrorEnum\"\x83\x03\n!ConversionGoalCampaignConfigError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12@\n\x12(\n$CANNOT_BID_MODIFY_NEGATIVE_CRITERION\x10?\x12\x1f\n\x1b\x42ID_MODIFIER_ALREADY_EXISTS\x10@\x12\x17\n\x13\x46\x45\x45\x44_ID_NOT_ALLOWED\x10\x41\x12(\n$ACCOUNT_INELIGIBLE_FOR_CRITERIA_TYPE\x10\x42\x12.\n*CRITERIA_TYPE_INVALID_FOR_BIDDING_STRATEGY\x10\x43\x12\x1c\n\x18\x43\x41NNOT_EXCLUDE_CRITERION\x10\x44\x12\x1b\n\x17\x43\x41NNOT_REMOVE_CRITERION\x10\x45\x12$\n INVALID_PRODUCT_BIDDING_CATEGORY\x10L\x12\x1c\n\x18MISSING_SHOPPING_SETTING\x10M\x12\x1d\n\x19INVALID_MATCHING_FUNCTION\x10N\x12\x1f\n\x1bLOCATION_FILTER_NOT_ALLOWED\x10O\x12$\n INVALID_FEED_FOR_LOCATION_FILTER\x10\x62\x12\x1b\n\x17LOCATION_FILTER_INVALID\x10P\x12\x37\n3CANNOT_SET_GEO_TARGET_CONSTANTS_WITH_FEED_ITEM_SETS\x10{\x12\'\n\"CANNOT_SET_BOTH_ASSET_SET_AND_FEED\x10\x8c\x01\x12\x33\n.CANNOT_SET_FEED_OR_FEED_ITEM_SETS_FOR_CUSTOMER\x10\x8e\x01\x12,\n\'CANNOT_SET_ASSET_SET_FIELD_FOR_CUSTOMER\x10\x96\x01\x12\x34\n/CANNOT_SET_GEO_TARGET_CONSTANTS_WITH_ASSET_SETS\x10\x8f\x01\x12.\n)CANNOT_SET_ASSET_SETS_WITH_FEED_ITEM_SETS\x10\x90\x01\x12%\n INVALID_LOCATION_GROUP_ASSET_SET\x10\x8d\x01\x12!\n\x1dINVALID_LOCATION_GROUP_RADIUS\x10|\x12&\n\"INVALID_LOCATION_GROUP_RADIUS_UNIT\x10}\x12\x32\n.CANNOT_ATTACH_CRITERIA_AT_CAMPAIGN_AND_ADGROUP\x10Q\x12\x39\n5HOTEL_LENGTH_OF_STAY_OVERLAPS_WITH_EXISTING_CRITERION\x10R\x12\x41\n=HOTEL_ADVANCE_BOOKING_WINDOW_OVERLAPS_WITH_EXISTING_CRITERION\x10S\x12.\n*FIELD_INCOMPATIBLE_WITH_NEGATIVE_TARGETING\x10T\x12\x1d\n\x19INVALID_WEBPAGE_CONDITION\x10U\x12!\n\x1dINVALID_WEBPAGE_CONDITION_URL\x10V\x12)\n%WEBPAGE_CONDITION_URL_CANNOT_BE_EMPTY\x10W\x12.\n*WEBPAGE_CONDITION_URL_UNSUPPORTED_PROTOCOL\x10X\x12.\n*WEBPAGE_CONDITION_URL_CANNOT_BE_IP_ADDRESS\x10Y\x12\x45\nAWEBPAGE_CONDITION_URL_DOMAIN_NOT_CONSISTENT_WITH_CAMPAIGN_SETTING\x10Z\x12\x31\n-WEBPAGE_CONDITION_URL_CANNOT_BE_PUBLIC_SUFFIX\x10[\x12/\n+WEBPAGE_CONDITION_URL_INVALID_PUBLIC_SUFFIX\x10\\\x12\x39\n5WEBPAGE_CONDITION_URL_VALUE_TRACK_VALUE_NOT_SUPPORTED\x10]\x12<\n8WEBPAGE_CRITERION_URL_EQUALS_CAN_HAVE_ONLY_ONE_CONDITION\x10^\x12\x37\n3WEBPAGE_CRITERION_NOT_SUPPORTED_ON_NON_DSA_AD_GROUP\x10_\x12\x37\n3CANNOT_TARGET_USER_LIST_FOR_SMART_DISPLAY_CAMPAIGNS\x10\x63\x12\x31\n-CANNOT_TARGET_PLACEMENTS_FOR_SEARCH_CAMPAIGNS\x10~\x12*\n&LISTING_SCOPE_TOO_MANY_DIMENSION_TYPES\x10\x64\x12\'\n#LISTING_SCOPE_TOO_MANY_IN_OPERATORS\x10\x65\x12+\n\'LISTING_SCOPE_IN_OPERATOR_NOT_SUPPORTED\x10\x66\x12$\n DUPLICATE_LISTING_DIMENSION_TYPE\x10g\x12%\n!DUPLICATE_LISTING_DIMENSION_VALUE\x10h\x12\x30\n,CANNOT_SET_BIDS_ON_LISTING_GROUP_SUBDIVISION\x10i\x12#\n\x1fINVALID_LISTING_GROUP_HIERARCHY\x10j\x12+\n\'LISTING_GROUP_UNIT_CANNOT_HAVE_CHILDREN\x10k\x12\x32\n.LISTING_GROUP_SUBDIVISION_REQUIRES_OTHERS_CASE\x10l\x12:\n6LISTING_GROUP_REQUIRES_SAME_DIMENSION_TYPE_AS_SIBLINGS\x10m\x12 \n\x1cLISTING_GROUP_ALREADY_EXISTS\x10n\x12 \n\x1cLISTING_GROUP_DOES_NOT_EXIST\x10o\x12#\n\x1fLISTING_GROUP_CANNOT_BE_REMOVED\x10p\x12\x1e\n\x1aINVALID_LISTING_GROUP_TYPE\x10q\x12*\n&LISTING_GROUP_ADD_MAY_ONLY_USE_TEMP_ID\x10r\x12\x1a\n\x16LISTING_SCOPE_TOO_LONG\x10s\x12%\n!LISTING_SCOPE_TOO_MANY_DIMENSIONS\x10t\x12\x1a\n\x16LISTING_GROUP_TOO_LONG\x10u\x12\x1f\n\x1bLISTING_GROUP_TREE_TOO_DEEP\x10v\x12\x1d\n\x19INVALID_LISTING_DIMENSION\x10w\x12\"\n\x1eINVALID_LISTING_DIMENSION_TYPE\x10x\x12@\n\n:CUSTOMER_ACQUISITION_HIGH_LIFETIME_VALUE_CANNOT_BE_CLEARED\x10\x06\x12\x1e\n\x1aINVALID_EXISTING_USER_LIST\x10\x07\x12)\n%INVALID_HIGH_LIFETIME_VALUE_USER_LIST\x10\x08\x42\xff\x01\n#com.google.ads.googleads.v16.errorsB\x1f\x43ustomerLifecycleGoalErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CustomerLifecycleGoalErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomerLifecycleGoalErrorEnum").msgclass + CustomerLifecycleGoalErrorEnum::CustomerLifecycleGoalError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomerLifecycleGoalErrorEnum.CustomerLifecycleGoalError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/customer_manager_link_error_pb.rb b/lib/google/ads/google_ads/v16/errors/customer_manager_link_error_pb.rb new file mode 100644 index 000000000..66e1cc70f --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/customer_manager_link_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/customer_manager_link_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/errors/customer_manager_link_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xd0\x03\n\x1c\x43ustomerManagerLinkErrorEnum\"\xaf\x03\n\x18\x43ustomerManagerLinkError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x15\n\x11NO_PENDING_INVITE\x10\x02\x12\'\n#SAME_CLIENT_MORE_THAN_ONCE_PER_CALL\x10\x03\x12-\n)MANAGER_HAS_MAX_NUMBER_OF_LINKED_ACCOUNTS\x10\x04\x12-\n)CANNOT_UNLINK_ACCOUNT_WITHOUT_ACTIVE_USER\x10\x05\x12+\n\'CANNOT_REMOVE_LAST_CLIENT_ACCOUNT_OWNER\x10\x06\x12+\n\'CANNOT_CHANGE_ROLE_BY_NON_ACCOUNT_OWNER\x10\x07\x12\x32\n.CANNOT_CHANGE_ROLE_FOR_NON_ACTIVE_LINK_ACCOUNT\x10\x08\x12\x19\n\x15\x44UPLICATE_CHILD_FOUND\x10\t\x12.\n*TEST_ACCOUNT_LINKS_TOO_MANY_CHILD_ACCOUNTS\x10\nB\xfd\x01\n#com.google.ads.googleads.v16.errorsB\x1d\x43ustomerManagerLinkErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CustomerManagerLinkErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomerManagerLinkErrorEnum").msgclass + CustomerManagerLinkErrorEnum::CustomerManagerLinkError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomerManagerLinkErrorEnum.CustomerManagerLinkError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/customer_sk_ad_network_conversion_value_schema_error_pb.rb b/lib/google/ads/google_ads/v16/errors/customer_sk_ad_network_conversion_value_schema_error_pb.rb new file mode 100644 index 000000000..a7cc66db9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/customer_sk_ad_network_conversion_value_schema_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/customer_sk_ad_network_conversion_value_schema_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nZgoogle/ads/googleads/v16/errors/customer_sk_ad_network_conversion_value_schema_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xd9\x01\n1CustomerSkAdNetworkConversionValueSchemaErrorEnum\"\xa3\x01\n-CustomerSkAdNetworkConversionValueSchemaError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x13\n\x0fINVALID_LINK_ID\x10\x02\x12\x12\n\x0eINVALID_APP_ID\x10\x03\x12\x12\n\x0eINVALID_SCHEMA\x10\x04\x12\x17\n\x13LINK_CODE_NOT_FOUND\x10\x05\x42\x92\x02\n#com.google.ads.googleads.v16.errorsB2CustomerSkAdNetworkConversionValueSchemaErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CustomerSkAdNetworkConversionValueSchemaErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomerSkAdNetworkConversionValueSchemaErrorEnum").msgclass + CustomerSkAdNetworkConversionValueSchemaErrorEnum::CustomerSkAdNetworkConversionValueSchemaError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomerSkAdNetworkConversionValueSchemaErrorEnum.CustomerSkAdNetworkConversionValueSchemaError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/customer_user_access_error_pb.rb b/lib/google/ads/google_ads/v16/errors/customer_user_access_error_pb.rb new file mode 100644 index 000000000..dd2b9b54f --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/customer_user_access_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/customer_user_access_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n@google/ads/googleads/v16/errors/customer_user_access_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xe9\x01\n\x1b\x43ustomerUserAccessErrorEnum\"\xc9\x01\n\x17\x43ustomerUserAccessError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x13\n\x0fINVALID_USER_ID\x10\x02\x12\x16\n\x12REMOVAL_DISALLOWED\x10\x03\x12\x1a\n\x16\x44ISALLOWED_ACCESS_ROLE\x10\x04\x12\'\n#LAST_ADMIN_USER_OF_SERVING_CUSTOMER\x10\x05\x12\x1e\n\x1aLAST_ADMIN_USER_OF_MANAGER\x10\x06\x42\xfc\x01\n#com.google.ads.googleads.v16.errorsB\x1c\x43ustomerUserAccessErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CustomerUserAccessErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomerUserAccessErrorEnum").msgclass + CustomerUserAccessErrorEnum::CustomerUserAccessError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomerUserAccessErrorEnum.CustomerUserAccessError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/customizer_attribute_error_pb.rb b/lib/google/ads/google_ads/v16/errors/customizer_attribute_error_pb.rb new file mode 100644 index 000000000..5052381a7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/customizer_attribute_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/customizer_attribute_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n@google/ads/googleads/v16/errors/customizer_attribute_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x81\x01\n\x1c\x43ustomizerAttributeErrorEnum\"a\n\x18\x43ustomizerAttributeError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\'\n#DUPLICATE_CUSTOMIZER_ATTRIBUTE_NAME\x10\x02\x42\xfd\x01\n#com.google.ads.googleads.v16.errorsB\x1d\x43ustomizerAttributeErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + CustomizerAttributeErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomizerAttributeErrorEnum").msgclass + CustomizerAttributeErrorEnum::CustomizerAttributeError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.CustomizerAttributeErrorEnum.CustomizerAttributeError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/database_error_pb.rb b/lib/google/ads/google_ads/v16/errors/database_error_pb.rb new file mode 100644 index 000000000..12e005f2b --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/database_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/database_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n4google/ads/googleads/v16/errors/database_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x96\x01\n\x11\x44\x61tabaseErrorEnum\"\x80\x01\n\rDatabaseError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1b\n\x17\x43ONCURRENT_MODIFICATION\x10\x02\x12\x1d\n\x19\x44\x41TA_CONSTRAINT_VIOLATION\x10\x03\x12\x15\n\x11REQUEST_TOO_LARGE\x10\x04\x42\xf2\x01\n#com.google.ads.googleads.v16.errorsB\x12\x44\x61tabaseErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + DatabaseErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.DatabaseErrorEnum").msgclass + DatabaseErrorEnum::DatabaseError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.DatabaseErrorEnum.DatabaseError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/date_error_pb.rb b/lib/google/ads/google_ads/v16/errors/date_error_pb.rb new file mode 100644 index 000000000..1a10aafca --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/date_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/date_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/ads/googleads/v16/errors/date_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xbf\x03\n\rDateErrorEnum\"\xad\x03\n\tDateError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12 \n\x1cINVALID_FIELD_VALUES_IN_DATE\x10\x02\x12%\n!INVALID_FIELD_VALUES_IN_DATE_TIME\x10\x03\x12\x17\n\x13INVALID_STRING_DATE\x10\x04\x12#\n\x1fINVALID_STRING_DATE_TIME_MICROS\x10\x06\x12$\n INVALID_STRING_DATE_TIME_SECONDS\x10\x0b\x12\x30\n,INVALID_STRING_DATE_TIME_SECONDS_WITH_OFFSET\x10\x0c\x12\x1d\n\x19\x45\x41RLIER_THAN_MINIMUM_DATE\x10\x07\x12\x1b\n\x17LATER_THAN_MAXIMUM_DATE\x10\x08\x12\x33\n/DATE_RANGE_MINIMUM_DATE_LATER_THAN_MAXIMUM_DATE\x10\t\x12\x32\n.DATE_RANGE_MINIMUM_AND_MAXIMUM_DATES_BOTH_NULL\x10\nB\xee\x01\n#com.google.ads.googleads.v16.errorsB\x0e\x44\x61teErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + DateErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.DateErrorEnum").msgclass + DateErrorEnum::DateError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.DateErrorEnum.DateError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/date_range_error_pb.rb b/lib/google/ads/google_ads/v16/errors/date_range_error_pb.rb new file mode 100644 index 000000000..2d79480bd --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/date_range_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/date_range_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/ads/googleads/v16/errors/date_range_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xe6\x01\n\x12\x44\x61teRangeErrorEnum\"\xcf\x01\n\x0e\x44\x61teRangeError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x10\n\x0cINVALID_DATE\x10\x02\x12\x1d\n\x19START_DATE_AFTER_END_DATE\x10\x03\x12\x1b\n\x17\x43\x41NNOT_SET_DATE_TO_PAST\x10\x04\x12 \n\x1c\x41\x46TER_MAXIMUM_ALLOWABLE_DATE\x10\x05\x12/\n+CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED\x10\x06\x42\xf3\x01\n#com.google.ads.googleads.v16.errorsB\x13\x44\x61teRangeErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + DateRangeErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.DateRangeErrorEnum").msgclass + DateRangeErrorEnum::DateRangeError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.DateRangeErrorEnum.DateRangeError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/distinct_error_pb.rb b/lib/google/ads/google_ads/v16/errors/distinct_error_pb.rb new file mode 100644 index 000000000..cf9267df6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/distinct_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/distinct_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n4google/ads/googleads/v16/errors/distinct_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"m\n\x11\x44istinctErrorEnum\"X\n\rDistinctError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x15\n\x11\x44UPLICATE_ELEMENT\x10\x02\x12\x12\n\x0e\x44UPLICATE_TYPE\x10\x03\x42\xf2\x01\n#com.google.ads.googleads.v16.errorsB\x12\x44istinctErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + DistinctErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.DistinctErrorEnum").msgclass + DistinctErrorEnum::DistinctError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.DistinctErrorEnum.DistinctError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/enum_error_pb.rb b/lib/google/ads/google_ads/v16/errors/enum_error_pb.rb new file mode 100644 index 000000000..ebdbb16d7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/enum_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/enum_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/ads/googleads/v16/errors/enum_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"X\n\rEnumErrorEnum\"G\n\tEnumError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1c\n\x18\x45NUM_VALUE_NOT_PERMITTED\x10\x03\x42\xee\x01\n#com.google.ads.googleads.v16.errorsB\x0e\x45numErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + EnumErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.EnumErrorEnum").msgclass + EnumErrorEnum::EnumError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.EnumErrorEnum.EnumError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/errors_pb.rb b/lib/google/ads/google_ads/v16/errors/errors_pb.rb new file mode 100644 index 000000000..867e272b7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/errors_pb.rb @@ -0,0 +1,213 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/errors.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/policy_pb' +require 'google/ads/google_ads/v16/common/value_pb' +require 'google/ads/google_ads/v16/enums/resource_limit_type_pb' +require 'google/ads/google_ads/v16/errors/access_invitation_error_pb' +require 'google/ads/google_ads/v16/errors/account_budget_proposal_error_pb' +require 'google/ads/google_ads/v16/errors/account_link_error_pb' +require 'google/ads/google_ads/v16/errors/ad_customizer_error_pb' +require 'google/ads/google_ads/v16/errors/ad_error_pb' +require 'google/ads/google_ads/v16/errors/ad_group_ad_error_pb' +require 'google/ads/google_ads/v16/errors/ad_group_bid_modifier_error_pb' +require 'google/ads/google_ads/v16/errors/ad_group_criterion_customizer_error_pb' +require 'google/ads/google_ads/v16/errors/ad_group_criterion_error_pb' +require 'google/ads/google_ads/v16/errors/ad_group_customizer_error_pb' +require 'google/ads/google_ads/v16/errors/ad_group_error_pb' +require 'google/ads/google_ads/v16/errors/ad_group_feed_error_pb' +require 'google/ads/google_ads/v16/errors/ad_parameter_error_pb' +require 'google/ads/google_ads/v16/errors/ad_sharing_error_pb' +require 'google/ads/google_ads/v16/errors/adx_error_pb' +require 'google/ads/google_ads/v16/errors/asset_error_pb' +require 'google/ads/google_ads/v16/errors/asset_group_asset_error_pb' +require 'google/ads/google_ads/v16/errors/asset_group_error_pb' +require 'google/ads/google_ads/v16/errors/asset_group_listing_group_filter_error_pb' +require 'google/ads/google_ads/v16/errors/asset_group_signal_error_pb' +require 'google/ads/google_ads/v16/errors/asset_link_error_pb' +require 'google/ads/google_ads/v16/errors/asset_set_asset_error_pb' +require 'google/ads/google_ads/v16/errors/asset_set_error_pb' +require 'google/ads/google_ads/v16/errors/asset_set_link_error_pb' +require 'google/ads/google_ads/v16/errors/audience_error_pb' +require 'google/ads/google_ads/v16/errors/audience_insights_error_pb' +require 'google/ads/google_ads/v16/errors/authentication_error_pb' +require 'google/ads/google_ads/v16/errors/authorization_error_pb' +require 'google/ads/google_ads/v16/errors/batch_job_error_pb' +require 'google/ads/google_ads/v16/errors/bidding_error_pb' +require 'google/ads/google_ads/v16/errors/bidding_strategy_error_pb' +require 'google/ads/google_ads/v16/errors/billing_setup_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_budget_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_conversion_goal_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_criterion_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_customizer_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_draft_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_experiment_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_feed_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_lifecycle_goal_error_pb' +require 'google/ads/google_ads/v16/errors/campaign_shared_set_error_pb' +require 'google/ads/google_ads/v16/errors/change_event_error_pb' +require 'google/ads/google_ads/v16/errors/change_status_error_pb' +require 'google/ads/google_ads/v16/errors/collection_size_error_pb' +require 'google/ads/google_ads/v16/errors/context_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_action_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_adjustment_upload_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_custom_variable_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_goal_campaign_config_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_upload_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_value_rule_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_value_rule_set_error_pb' +require 'google/ads/google_ads/v16/errors/country_code_error_pb' +require 'google/ads/google_ads/v16/errors/criterion_error_pb' +require 'google/ads/google_ads/v16/errors/currency_code_error_pb' +require 'google/ads/google_ads/v16/errors/currency_error_pb' +require 'google/ads/google_ads/v16/errors/custom_audience_error_pb' +require 'google/ads/google_ads/v16/errors/custom_conversion_goal_error_pb' +require 'google/ads/google_ads/v16/errors/custom_interest_error_pb' +require 'google/ads/google_ads/v16/errors/customer_client_link_error_pb' +require 'google/ads/google_ads/v16/errors/customer_customizer_error_pb' +require 'google/ads/google_ads/v16/errors/customer_error_pb' +require 'google/ads/google_ads/v16/errors/customer_feed_error_pb' +require 'google/ads/google_ads/v16/errors/customer_lifecycle_goal_error_pb' +require 'google/ads/google_ads/v16/errors/customer_manager_link_error_pb' +require 'google/ads/google_ads/v16/errors/customer_sk_ad_network_conversion_value_schema_error_pb' +require 'google/ads/google_ads/v16/errors/customer_user_access_error_pb' +require 'google/ads/google_ads/v16/errors/customizer_attribute_error_pb' +require 'google/ads/google_ads/v16/errors/database_error_pb' +require 'google/ads/google_ads/v16/errors/date_error_pb' +require 'google/ads/google_ads/v16/errors/date_range_error_pb' +require 'google/ads/google_ads/v16/errors/distinct_error_pb' +require 'google/ads/google_ads/v16/errors/enum_error_pb' +require 'google/ads/google_ads/v16/errors/experiment_arm_error_pb' +require 'google/ads/google_ads/v16/errors/experiment_error_pb' +require 'google/ads/google_ads/v16/errors/extension_feed_item_error_pb' +require 'google/ads/google_ads/v16/errors/extension_setting_error_pb' +require 'google/ads/google_ads/v16/errors/feed_attribute_reference_error_pb' +require 'google/ads/google_ads/v16/errors/feed_error_pb' +require 'google/ads/google_ads/v16/errors/feed_item_error_pb' +require 'google/ads/google_ads/v16/errors/feed_item_set_error_pb' +require 'google/ads/google_ads/v16/errors/feed_item_set_link_error_pb' +require 'google/ads/google_ads/v16/errors/feed_item_target_error_pb' +require 'google/ads/google_ads/v16/errors/feed_item_validation_error_pb' +require 'google/ads/google_ads/v16/errors/feed_mapping_error_pb' +require 'google/ads/google_ads/v16/errors/field_error_pb' +require 'google/ads/google_ads/v16/errors/field_mask_error_pb' +require 'google/ads/google_ads/v16/errors/function_error_pb' +require 'google/ads/google_ads/v16/errors/function_parsing_error_pb' +require 'google/ads/google_ads/v16/errors/geo_target_constant_suggestion_error_pb' +require 'google/ads/google_ads/v16/errors/header_error_pb' +require 'google/ads/google_ads/v16/errors/id_error_pb' +require 'google/ads/google_ads/v16/errors/identity_verification_error_pb' +require 'google/ads/google_ads/v16/errors/image_error_pb' +require 'google/ads/google_ads/v16/errors/internal_error_pb' +require 'google/ads/google_ads/v16/errors/invoice_error_pb' +require 'google/ads/google_ads/v16/errors/keyword_plan_ad_group_error_pb' +require 'google/ads/google_ads/v16/errors/keyword_plan_ad_group_keyword_error_pb' +require 'google/ads/google_ads/v16/errors/keyword_plan_campaign_error_pb' +require 'google/ads/google_ads/v16/errors/keyword_plan_campaign_keyword_error_pb' +require 'google/ads/google_ads/v16/errors/keyword_plan_error_pb' +require 'google/ads/google_ads/v16/errors/keyword_plan_idea_error_pb' +require 'google/ads/google_ads/v16/errors/label_error_pb' +require 'google/ads/google_ads/v16/errors/language_code_error_pb' +require 'google/ads/google_ads/v16/errors/list_operation_error_pb' +require 'google/ads/google_ads/v16/errors/manager_link_error_pb' +require 'google/ads/google_ads/v16/errors/media_bundle_error_pb' +require 'google/ads/google_ads/v16/errors/media_file_error_pb' +require 'google/ads/google_ads/v16/errors/media_upload_error_pb' +require 'google/ads/google_ads/v16/errors/merchant_center_error_pb' +require 'google/ads/google_ads/v16/errors/multiplier_error_pb' +require 'google/ads/google_ads/v16/errors/mutate_error_pb' +require 'google/ads/google_ads/v16/errors/new_resource_creation_error_pb' +require 'google/ads/google_ads/v16/errors/not_allowlisted_error_pb' +require 'google/ads/google_ads/v16/errors/not_empty_error_pb' +require 'google/ads/google_ads/v16/errors/null_error_pb' +require 'google/ads/google_ads/v16/errors/offline_user_data_job_error_pb' +require 'google/ads/google_ads/v16/errors/operation_access_denied_error_pb' +require 'google/ads/google_ads/v16/errors/operator_error_pb' +require 'google/ads/google_ads/v16/errors/partial_failure_error_pb' +require 'google/ads/google_ads/v16/errors/payments_account_error_pb' +require 'google/ads/google_ads/v16/errors/policy_finding_error_pb' +require 'google/ads/google_ads/v16/errors/policy_validation_parameter_error_pb' +require 'google/ads/google_ads/v16/errors/policy_violation_error_pb' +require 'google/ads/google_ads/v16/errors/product_link_error_pb' +require 'google/ads/google_ads/v16/errors/product_link_invitation_error_pb' +require 'google/ads/google_ads/v16/errors/query_error_pb' +require 'google/ads/google_ads/v16/errors/quota_error_pb' +require 'google/ads/google_ads/v16/errors/range_error_pb' +require 'google/ads/google_ads/v16/errors/reach_plan_error_pb' +require 'google/ads/google_ads/v16/errors/recommendation_error_pb' +require 'google/ads/google_ads/v16/errors/recommendation_subscription_error_pb' +require 'google/ads/google_ads/v16/errors/region_code_error_pb' +require 'google/ads/google_ads/v16/errors/request_error_pb' +require 'google/ads/google_ads/v16/errors/resource_access_denied_error_pb' +require 'google/ads/google_ads/v16/errors/resource_count_limit_exceeded_error_pb' +require 'google/ads/google_ads/v16/errors/search_term_insight_error_pb' +require 'google/ads/google_ads/v16/errors/setting_error_pb' +require 'google/ads/google_ads/v16/errors/shared_criterion_error_pb' +require 'google/ads/google_ads/v16/errors/shared_set_error_pb' +require 'google/ads/google_ads/v16/errors/size_limit_error_pb' +require 'google/ads/google_ads/v16/errors/smart_campaign_error_pb' +require 'google/ads/google_ads/v16/errors/string_format_error_pb' +require 'google/ads/google_ads/v16/errors/string_length_error_pb' +require 'google/ads/google_ads/v16/errors/third_party_app_analytics_link_error_pb' +require 'google/ads/google_ads/v16/errors/time_zone_error_pb' +require 'google/ads/google_ads/v16/errors/url_field_error_pb' +require 'google/ads/google_ads/v16/errors/user_data_error_pb' +require 'google/ads/google_ads/v16/errors/user_list_error_pb' +require 'google/ads/google_ads/v16/errors/youtube_video_registration_error_pb' +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n,google/ads/googleads/v16/errors/errors.proto\x12\x1fgoogle.ads.googleads.v16.errors\x1a,google/ads/googleads/v16/common/policy.proto\x1a+google/ads/googleads/v16/common/value.proto\x1a\x38google/ads/googleads/v16/enums/resource_limit_type.proto\x1a=google/ads/googleads/v16/errors/access_invitation_error.proto\x1a\x43google/ads/googleads/v16/errors/account_budget_proposal_error.proto\x1a\x38google/ads/googleads/v16/errors/account_link_error.proto\x1a\x39google/ads/googleads/v16/errors/ad_customizer_error.proto\x1a.google/ads/googleads/v16/errors/ad_error.proto\x1a\x37google/ads/googleads/v16/errors/ad_group_ad_error.proto\x1a\x41google/ads/googleads/v16/errors/ad_group_bid_modifier_error.proto\x1aIgoogle/ads/googleads/v16/errors/ad_group_criterion_customizer_error.proto\x1a>google/ads/googleads/v16/errors/ad_group_criterion_error.proto\x1a?google/ads/googleads/v16/errors/ad_group_customizer_error.proto\x1a\x34google/ads/googleads/v16/errors/ad_group_error.proto\x1a\x39google/ads/googleads/v16/errors/ad_group_feed_error.proto\x1a\x38google/ads/googleads/v16/errors/ad_parameter_error.proto\x1a\x36google/ads/googleads/v16/errors/ad_sharing_error.proto\x1a/google/ads/googleads/v16/errors/adx_error.proto\x1a\x31google/ads/googleads/v16/errors/asset_error.proto\x1a=google/ads/googleads/v16/errors/asset_group_asset_error.proto\x1a\x37google/ads/googleads/v16/errors/asset_group_error.proto\x1aLgoogle/ads/googleads/v16/errors/asset_group_listing_group_filter_error.proto\x1a>google/ads/googleads/v16/errors/asset_group_signal_error.proto\x1a\x36google/ads/googleads/v16/errors/asset_link_error.proto\x1a;google/ads/googleads/v16/errors/asset_set_asset_error.proto\x1a\x35google/ads/googleads/v16/errors/asset_set_error.proto\x1a:google/ads/googleads/v16/errors/asset_set_link_error.proto\x1a\x34google/ads/googleads/v16/errors/audience_error.proto\x1a=google/ads/googleads/v16/errors/audience_insights_error.proto\x1a:google/ads/googleads/v16/errors/authentication_error.proto\x1a\x39google/ads/googleads/v16/errors/authorization_error.proto\x1a\x35google/ads/googleads/v16/errors/batch_job_error.proto\x1a\x33google/ads/googleads/v16/errors/bidding_error.proto\x1agoogle/ads/googleads/v16/errors/campaign_criterion_error.proto\x1a?google/ads/googleads/v16/errors/campaign_customizer_error.proto\x1a:google/ads/googleads/v16/errors/campaign_draft_error.proto\x1a\x34google/ads/googleads/v16/errors/campaign_error.proto\x1a?google/ads/googleads/v16/errors/campaign_experiment_error.proto\x1a\x39google/ads/googleads/v16/errors/campaign_feed_error.proto\x1a\x43google/ads/googleads/v16/errors/campaign_lifecycle_goal_error.proto\x1a?google/ads/googleads/v16/errors/campaign_shared_set_error.proto\x1a\x38google/ads/googleads/v16/errors/change_event_error.proto\x1a\x39google/ads/googleads/v16/errors/change_status_error.proto\x1a;google/ads/googleads/v16/errors/collection_size_error.proto\x1a\x33google/ads/googleads/v16/errors/context_error.proto\x1a=google/ads/googleads/v16/errors/conversion_action_error.proto\x1aHgoogle/ads/googleads/v16/errors/conversion_adjustment_upload_error.proto\x1a\x46google/ads/googleads/v16/errors/conversion_custom_variable_error.proto\x1aKgoogle/ads/googleads/v16/errors/conversion_goal_campaign_config_error.proto\x1a=google/ads/googleads/v16/errors/conversion_upload_error.proto\x1a\x41google/ads/googleads/v16/errors/conversion_value_rule_error.proto\x1a\x45google/ads/googleads/v16/errors/conversion_value_rule_set_error.proto\x1a\x38google/ads/googleads/v16/errors/country_code_error.proto\x1a\x35google/ads/googleads/v16/errors/criterion_error.proto\x1a\x39google/ads/googleads/v16/errors/currency_code_error.proto\x1a\x34google/ads/googleads/v16/errors/currency_error.proto\x1a;google/ads/googleads/v16/errors/custom_audience_error.proto\x1a\x42google/ads/googleads/v16/errors/custom_conversion_goal_error.proto\x1a;google/ads/googleads/v16/errors/custom_interest_error.proto\x1a@google/ads/googleads/v16/errors/customer_client_link_error.proto\x1a?google/ads/googleads/v16/errors/customer_customizer_error.proto\x1a\x34google/ads/googleads/v16/errors/customer_error.proto\x1a\x39google/ads/googleads/v16/errors/customer_feed_error.proto\x1a\x43google/ads/googleads/v16/errors/customer_lifecycle_goal_error.proto\x1a\x41google/ads/googleads/v16/errors/customer_manager_link_error.proto\x1aZgoogle/ads/googleads/v16/errors/customer_sk_ad_network_conversion_value_schema_error.proto\x1a@google/ads/googleads/v16/errors/customer_user_access_error.proto\x1a@google/ads/googleads/v16/errors/customizer_attribute_error.proto\x1a\x34google/ads/googleads/v16/errors/database_error.proto\x1a\x30google/ads/googleads/v16/errors/date_error.proto\x1a\x36google/ads/googleads/v16/errors/date_range_error.proto\x1a\x34google/ads/googleads/v16/errors/distinct_error.proto\x1a\x30google/ads/googleads/v16/errors/enum_error.proto\x1a:google/ads/googleads/v16/errors/experiment_arm_error.proto\x1a\x36google/ads/googleads/v16/errors/experiment_error.proto\x1a?google/ads/googleads/v16/errors/extension_feed_item_error.proto\x1a=google/ads/googleads/v16/errors/extension_setting_error.proto\x1a\x44google/ads/googleads/v16/errors/feed_attribute_reference_error.proto\x1a\x30google/ads/googleads/v16/errors/feed_error.proto\x1a\x35google/ads/googleads/v16/errors/feed_item_error.proto\x1a\x39google/ads/googleads/v16/errors/feed_item_set_error.proto\x1a>google/ads/googleads/v16/errors/feed_item_set_link_error.proto\x1a\n\nerror_code\x18\x01 \x01(\x0b\x32*.google.ads.googleads.v16.errors.ErrorCode\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x37\n\x07trigger\x18\x03 \x01(\x0b\x32&.google.ads.googleads.v16.common.Value\x12@\n\x08location\x18\x04 \x01(\x0b\x32..google.ads.googleads.v16.errors.ErrorLocation\x12>\n\x07\x64\x65tails\x18\x05 \x01(\x0b\x32-.google.ads.googleads.v16.errors.ErrorDetails\"\xa5\x82\x01\n\tErrorCode\x12W\n\rrequest_error\x18\x01 \x01(\x0e\x32>.google.ads.googleads.v16.errors.RequestErrorEnum.RequestErrorH\x00\x12p\n\x16\x62idding_strategy_error\x18\x02 \x01(\x0e\x32N.google.ads.googleads.v16.errors.BiddingStrategyErrorEnum.BiddingStrategyErrorH\x00\x12[\n\x0furl_field_error\x18\x03 \x01(\x0e\x32@.google.ads.googleads.v16.errors.UrlFieldErrorEnum.UrlFieldErrorH\x00\x12j\n\x14list_operation_error\x18\x04 \x01(\x0e\x32J.google.ads.googleads.v16.errors.ListOperationErrorEnum.ListOperationErrorH\x00\x12Q\n\x0bquery_error\x18\x05 \x01(\x0e\x32:.google.ads.googleads.v16.errors.QueryErrorEnum.QueryErrorH\x00\x12T\n\x0cmutate_error\x18\x07 \x01(\x0e\x32<.google.ads.googleads.v16.errors.MutateErrorEnum.MutateErrorH\x00\x12^\n\x10\x66ield_mask_error\x18\x08 \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.FieldMaskErrorEnum.FieldMaskErrorH\x00\x12i\n\x13\x61uthorization_error\x18\t \x01(\x0e\x32J.google.ads.googleads.v16.errors.AuthorizationErrorEnum.AuthorizationErrorH\x00\x12Z\n\x0einternal_error\x18\n \x01(\x0e\x32@.google.ads.googleads.v16.errors.InternalErrorEnum.InternalErrorH\x00\x12Q\n\x0bquota_error\x18\x0b \x01(\x0e\x32:.google.ads.googleads.v16.errors.QuotaErrorEnum.QuotaErrorH\x00\x12H\n\x08\x61\x64_error\x18\x0c \x01(\x0e\x32\x34.google.ads.googleads.v16.errors.AdErrorEnum.AdErrorH\x00\x12X\n\x0e\x61\x64_group_error\x18\r \x01(\x0e\x32>.google.ads.googleads.v16.errors.AdGroupErrorEnum.AdGroupErrorH\x00\x12m\n\x15\x63\x61mpaign_budget_error\x18\x0e \x01(\x0e\x32L.google.ads.googleads.v16.errors.CampaignBudgetErrorEnum.CampaignBudgetErrorH\x00\x12Z\n\x0e\x63\x61mpaign_error\x18\x0f \x01(\x0e\x32@.google.ads.googleads.v16.errors.CampaignErrorEnum.CampaignErrorH\x00\x12l\n\x14\x61uthentication_error\x18\x11 \x01(\x0e\x32L.google.ads.googleads.v16.errors.AuthenticationErrorEnum.AuthenticationErrorH\x00\x12\x94\x01\n#ad_group_criterion_customizer_error\x18\xa1\x01 \x01(\x0e\x32\x64.google.ads.googleads.v16.errors.AdGroupCriterionCustomizerErrorEnum.AdGroupCriterionCustomizerErrorH\x00\x12t\n\x18\x61\x64_group_criterion_error\x18\x12 \x01(\x0e\x32P.google.ads.googleads.v16.errors.AdGroupCriterionErrorEnum.AdGroupCriterionErrorH\x00\x12x\n\x19\x61\x64_group_customizer_error\x18\x9f\x01 \x01(\x0e\x32R.google.ads.googleads.v16.errors.AdGroupCustomizerErrorEnum.AdGroupCustomizerErrorH\x00\x12g\n\x13\x61\x64_customizer_error\x18\x13 \x01(\x0e\x32H.google.ads.googleads.v16.errors.AdCustomizerErrorEnum.AdCustomizerErrorH\x00\x12_\n\x11\x61\x64_group_ad_error\x18\x15 \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.AdGroupAdErrorEnum.AdGroupAdErrorH\x00\x12^\n\x10\x61\x64_sharing_error\x18\x18 \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.AdSharingErrorEnum.AdSharingErrorH\x00\x12K\n\tadx_error\x18\x19 \x01(\x0e\x32\x36.google.ads.googleads.v16.errors.AdxErrorEnum.AdxErrorH\x00\x12Q\n\x0b\x61sset_error\x18k \x01(\x0e\x32:.google.ads.googleads.v16.errors.AssetErrorEnum.AssetErrorH\x00\x12r\n\x17\x61sset_group_asset_error\x18\x95\x01 \x01(\x0e\x32N.google.ads.googleads.v16.errors.AssetGroupAssetErrorEnum.AssetGroupAssetErrorH\x00\x12\x9b\x01\n&asset_group_listing_group_filter_error\x18\x9b\x01 \x01(\x0e\x32h.google.ads.googleads.v16.errors.AssetGroupListingGroupFilterErrorEnum.AssetGroupListingGroupFilterErrorH\x00\x12\x62\n\x11\x61sset_group_error\x18\x94\x01 \x01(\x0e\x32\x44.google.ads.googleads.v16.errors.AssetGroupErrorEnum.AssetGroupErrorH\x00\x12l\n\x15\x61sset_set_asset_error\x18\x99\x01 \x01(\x0e\x32J.google.ads.googleads.v16.errors.AssetSetAssetErrorEnum.AssetSetAssetErrorH\x00\x12i\n\x14\x61sset_set_link_error\x18\x9a\x01 \x01(\x0e\x32H.google.ads.googleads.v16.errors.AssetSetLinkErrorEnum.AssetSetLinkErrorH\x00\x12\\\n\x0f\x61sset_set_error\x18\x98\x01 \x01(\x0e\x32@.google.ads.googleads.v16.errors.AssetSetErrorEnum.AssetSetErrorH\x00\x12W\n\rbidding_error\x18\x1a \x01(\x0e\x32>.google.ads.googleads.v16.errors.BiddingErrorEnum.BiddingErrorH\x00\x12v\n\x18\x63\x61mpaign_criterion_error\x18\x1d \x01(\x0e\x32R.google.ads.googleads.v16.errors.CampaignCriterionErrorEnum.CampaignCriterionErrorH\x00\x12\x87\x01\n\x1e\x63\x61mpaign_conversion_goal_error\x18\xa6\x01 \x01(\x0e\x32\\.google.ads.googleads.v16.errors.CampaignConversionGoalErrorEnum.CampaignConversionGoalErrorH\x00\x12z\n\x19\x63\x61mpaign_customizer_error\x18\xa0\x01 \x01(\x0e\x32T.google.ads.googleads.v16.errors.CampaignCustomizerErrorEnum.CampaignCustomizerErrorH\x00\x12m\n\x15\x63ollection_size_error\x18\x1f \x01(\x0e\x32L.google.ads.googleads.v16.errors.CollectionSizeErrorEnum.CollectionSizeErrorH\x00\x12\x9a\x01\n%conversion_goal_campaign_config_error\x18\xa5\x01 \x01(\x0e\x32h.google.ads.googleads.v16.errors.ConversionGoalCampaignConfigErrorEnum.ConversionGoalCampaignConfigErrorH\x00\x12\x64\n\x12\x63ountry_code_error\x18m \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.CountryCodeErrorEnum.CountryCodeErrorH\x00\x12]\n\x0f\x63riterion_error\x18 \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.CriterionErrorEnum.CriterionErrorH\x00\x12\x81\x01\n\x1c\x63ustom_conversion_goal_error\x18\x96\x01 \x01(\x0e\x32X.google.ads.googleads.v16.errors.CustomConversionGoalErrorEnum.CustomConversionGoalErrorH\x00\x12z\n\x19\x63ustomer_customizer_error\x18\x9e\x01 \x01(\x0e\x32T.google.ads.googleads.v16.errors.CustomerCustomizerErrorEnum.CustomerCustomizerErrorH\x00\x12Z\n\x0e\x63ustomer_error\x18Z \x01(\x0e\x32@.google.ads.googleads.v16.errors.CustomerErrorEnum.CustomerErrorH\x00\x12}\n\x1a\x63ustomizer_attribute_error\x18\x97\x01 \x01(\x0e\x32V.google.ads.googleads.v16.errors.CustomizerAttributeErrorEnum.CustomizerAttributeErrorH\x00\x12N\n\ndate_error\x18! \x01(\x0e\x32\x38.google.ads.googleads.v16.errors.DateErrorEnum.DateErrorH\x00\x12^\n\x10\x64\x61te_range_error\x18\" \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.DateRangeErrorEnum.DateRangeErrorH\x00\x12Z\n\x0e\x64istinct_error\x18# \x01(\x0e\x32@.google.ads.googleads.v16.errors.DistinctErrorEnum.DistinctErrorH\x00\x12\x86\x01\n\x1e\x66\x65\x65\x64_attribute_reference_error\x18$ \x01(\x0e\x32\\.google.ads.googleads.v16.errors.FeedAttributeReferenceErrorEnum.FeedAttributeReferenceErrorH\x00\x12Z\n\x0e\x66unction_error\x18% \x01(\x0e\x32@.google.ads.googleads.v16.errors.FunctionErrorEnum.FunctionErrorH\x00\x12p\n\x16\x66unction_parsing_error\x18& \x01(\x0e\x32N.google.ads.googleads.v16.errors.FunctionParsingErrorEnum.FunctionParsingErrorH\x00\x12H\n\x08id_error\x18\' \x01(\x0e\x32\x34.google.ads.googleads.v16.errors.IdErrorEnum.IdErrorH\x00\x12Q\n\x0bimage_error\x18( \x01(\x0e\x32:.google.ads.googleads.v16.errors.ImageErrorEnum.ImageErrorH\x00\x12g\n\x13language_code_error\x18n \x01(\x0e\x32H.google.ads.googleads.v16.errors.LanguageCodeErrorEnum.LanguageCodeErrorH\x00\x12\x64\n\x12media_bundle_error\x18* \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.MediaBundleErrorEnum.MediaBundleErrorH\x00\x12\x64\n\x12media_upload_error\x18t \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.MediaUploadErrorEnum.MediaUploadErrorH\x00\x12^\n\x10media_file_error\x18V \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.MediaFileErrorEnum.MediaFileErrorH\x00\x12n\n\x15merchant_center_error\x18\xa2\x01 \x01(\x0e\x32L.google.ads.googleads.v16.errors.MerchantCenterErrorEnum.MerchantCenterErrorH\x00\x12`\n\x10multiplier_error\x18, \x01(\x0e\x32\x44.google.ads.googleads.v16.errors.MultiplierErrorEnum.MultiplierErrorH\x00\x12}\n\x1bnew_resource_creation_error\x18- \x01(\x0e\x32V.google.ads.googleads.v16.errors.NewResourceCreationErrorEnum.NewResourceCreationErrorH\x00\x12[\n\x0fnot_empty_error\x18. \x01(\x0e\x32@.google.ads.googleads.v16.errors.NotEmptyErrorEnum.NotEmptyErrorH\x00\x12N\n\nnull_error\x18/ \x01(\x0e\x32\x38.google.ads.googleads.v16.errors.NullErrorEnum.NullErrorH\x00\x12Z\n\x0eoperator_error\x18\x30 \x01(\x0e\x32@.google.ads.googleads.v16.errors.OperatorErrorEnum.OperatorErrorH\x00\x12Q\n\x0brange_error\x18\x31 \x01(\x0e\x32:.google.ads.googleads.v16.errors.RangeErrorEnum.RangeErrorH\x00\x12l\n\x14recommendation_error\x18: \x01(\x0e\x32L.google.ads.googleads.v16.errors.RecommendationErrorEnum.RecommendationErrorH\x00\x12\x92\x01\n!recommendation_subscription_error\x18\xb4\x01 \x01(\x0e\x32\x64.google.ads.googleads.v16.errors.RecommendationSubscriptionErrorEnum.RecommendationSubscriptionErrorH\x00\x12\x61\n\x11region_code_error\x18\x33 \x01(\x0e\x32\x44.google.ads.googleads.v16.errors.RegionCodeErrorEnum.RegionCodeErrorH\x00\x12W\n\rsetting_error\x18\x34 \x01(\x0e\x32>.google.ads.googleads.v16.errors.SettingErrorEnum.SettingErrorH\x00\x12g\n\x13string_format_error\x18\x35 \x01(\x0e\x32H.google.ads.googleads.v16.errors.StringFormatErrorEnum.StringFormatErrorH\x00\x12g\n\x13string_length_error\x18\x36 \x01(\x0e\x32H.google.ads.googleads.v16.errors.StringLengthErrorEnum.StringLengthErrorH\x00\x12\x83\x01\n\x1doperation_access_denied_error\x18\x37 \x01(\x0e\x32Z.google.ads.googleads.v16.errors.OperationAccessDeniedErrorEnum.OperationAccessDeniedErrorH\x00\x12\x80\x01\n\x1cresource_access_denied_error\x18\x38 \x01(\x0e\x32X.google.ads.googleads.v16.errors.ResourceAccessDeniedErrorEnum.ResourceAccessDeniedErrorH\x00\x12\x93\x01\n#resource_count_limit_exceeded_error\x18\x39 \x01(\x0e\x32\x64.google.ads.googleads.v16.errors.ResourceCountLimitExceededErrorEnum.ResourceCountLimitExceededErrorH\x00\x12\x8c\x01\n youtube_video_registration_error\x18u \x01(\x0e\x32`.google.ads.googleads.v16.errors.YoutubeVideoRegistrationErrorEnum.YoutubeVideoRegistrationErrorH\x00\x12{\n\x1b\x61\x64_group_bid_modifier_error\x18; \x01(\x0e\x32T.google.ads.googleads.v16.errors.AdGroupBidModifierErrorEnum.AdGroupBidModifierErrorH\x00\x12W\n\rcontext_error\x18< \x01(\x0e\x32>.google.ads.googleads.v16.errors.ContextErrorEnum.ContextErrorH\x00\x12Q\n\x0b\x66ield_error\x18= \x01(\x0e\x32:.google.ads.googleads.v16.errors.FieldErrorEnum.FieldErrorH\x00\x12^\n\x10shared_set_error\x18> \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.SharedSetErrorEnum.SharedSetErrorH\x00\x12p\n\x16shared_criterion_error\x18? \x01(\x0e\x32N.google.ads.googleads.v16.errors.SharedCriterionErrorEnum.SharedCriterionErrorH\x00\x12w\n\x19\x63\x61mpaign_shared_set_error\x18@ \x01(\x0e\x32R.google.ads.googleads.v16.errors.CampaignSharedSetErrorEnum.CampaignSharedSetErrorH\x00\x12s\n\x17\x63onversion_action_error\x18\x41 \x01(\x0e\x32P.google.ads.googleads.v16.errors.ConversionActionErrorEnum.ConversionActionErrorH\x00\x12\x92\x01\n\"conversion_adjustment_upload_error\x18s \x01(\x0e\x32\x64.google.ads.googleads.v16.errors.ConversionAdjustmentUploadErrorEnum.ConversionAdjustmentUploadErrorH\x00\x12\x8d\x01\n conversion_custom_variable_error\x18\x8f\x01 \x01(\x0e\x32`.google.ads.googleads.v16.errors.ConversionCustomVariableErrorEnum.ConversionCustomVariableErrorH\x00\x12s\n\x17\x63onversion_upload_error\x18o \x01(\x0e\x32P.google.ads.googleads.v16.errors.ConversionUploadErrorEnum.ConversionUploadErrorH\x00\x12~\n\x1b\x63onversion_value_rule_error\x18\x91\x01 \x01(\x0e\x32V.google.ads.googleads.v16.errors.ConversionValueRuleErrorEnum.ConversionValueRuleErrorH\x00\x12\x88\x01\n\x1f\x63onversion_value_rule_set_error\x18\x92\x01 \x01(\x0e\x32\\.google.ads.googleads.v16.errors.ConversionValueRuleSetErrorEnum.ConversionValueRuleSetErrorH\x00\x12T\n\x0cheader_error\x18\x42 \x01(\x0e\x32<.google.ads.googleads.v16.errors.HeaderErrorEnum.HeaderErrorH\x00\x12Z\n\x0e\x64\x61tabase_error\x18\x43 \x01(\x0e\x32@.google.ads.googleads.v16.errors.DatabaseErrorEnum.DatabaseErrorH\x00\x12j\n\x14policy_finding_error\x18\x44 \x01(\x0e\x32J.google.ads.googleads.v16.errors.PolicyFindingErrorEnum.PolicyFindingErrorH\x00\x12N\n\nenum_error\x18\x46 \x01(\x0e\x32\x38.google.ads.googleads.v16.errors.EnumErrorEnum.EnumErrorH\x00\x12\x64\n\x12keyword_plan_error\x18G \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.KeywordPlanErrorEnum.KeywordPlanErrorH\x00\x12}\n\x1bkeyword_plan_campaign_error\x18H \x01(\x0e\x32V.google.ads.googleads.v16.errors.KeywordPlanCampaignErrorEnum.KeywordPlanCampaignErrorH\x00\x12\x94\x01\n#keyword_plan_campaign_keyword_error\x18\x84\x01 \x01(\x0e\x32\x64.google.ads.googleads.v16.errors.KeywordPlanCampaignKeywordErrorEnum.KeywordPlanCampaignKeywordErrorH\x00\x12{\n\x1bkeyword_plan_ad_group_error\x18J \x01(\x0e\x32T.google.ads.googleads.v16.errors.KeywordPlanAdGroupErrorEnum.KeywordPlanAdGroupErrorH\x00\x12\x92\x01\n#keyword_plan_ad_group_keyword_error\x18\x85\x01 \x01(\x0e\x32\x62.google.ads.googleads.v16.errors.KeywordPlanAdGroupKeywordErrorEnum.KeywordPlanAdGroupKeywordErrorH\x00\x12q\n\x17keyword_plan_idea_error\x18L \x01(\x0e\x32N.google.ads.googleads.v16.errors.KeywordPlanIdeaErrorEnum.KeywordPlanIdeaErrorH\x00\x12\x83\x01\n\x1d\x61\x63\x63ount_budget_proposal_error\x18M \x01(\x0e\x32Z.google.ads.googleads.v16.errors.AccountBudgetProposalErrorEnum.AccountBudgetProposalErrorH\x00\x12[\n\x0fuser_list_error\x18N \x01(\x0e\x32@.google.ads.googleads.v16.errors.UserListErrorEnum.UserListErrorH\x00\x12\x65\n\x12\x63hange_event_error\x18\x88\x01 \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.ChangeEventErrorEnum.ChangeEventErrorH\x00\x12g\n\x13\x63hange_status_error\x18O \x01(\x0e\x32H.google.ads.googleads.v16.errors.ChangeStatusErrorEnum.ChangeStatusErrorH\x00\x12N\n\nfeed_error\x18P \x01(\x0e\x32\x38.google.ads.googleads.v16.errors.FeedErrorEnum.FeedErrorH\x00\x12\x96\x01\n$geo_target_constant_suggestion_error\x18Q \x01(\x0e\x32\x66.google.ads.googleads.v16.errors.GeoTargetConstantSuggestionErrorEnum.GeoTargetConstantSuggestionErrorH\x00\x12j\n\x14\x63\x61mpaign_draft_error\x18R \x01(\x0e\x32J.google.ads.googleads.v16.errors.CampaignDraftErrorEnum.CampaignDraftErrorH\x00\x12[\n\x0f\x66\x65\x65\x64_item_error\x18S \x01(\x0e\x32@.google.ads.googleads.v16.errors.FeedItemErrorEnum.FeedItemErrorH\x00\x12Q\n\x0blabel_error\x18T \x01(\x0e\x32:.google.ads.googleads.v16.errors.LabelErrorEnum.LabelErrorH\x00\x12g\n\x13\x62illing_setup_error\x18W \x01(\x0e\x32H.google.ads.googleads.v16.errors.BillingSetupErrorEnum.BillingSetupErrorH\x00\x12z\n\x1a\x63ustomer_client_link_error\x18X \x01(\x0e\x32T.google.ads.googleads.v16.errors.CustomerClientLinkErrorEnum.CustomerClientLinkErrorH\x00\x12}\n\x1b\x63ustomer_manager_link_error\x18[ \x01(\x0e\x32V.google.ads.googleads.v16.errors.CustomerManagerLinkErrorEnum.CustomerManagerLinkErrorH\x00\x12\x64\n\x12\x66\x65\x65\x64_mapping_error\x18\\ \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.FeedMappingErrorEnum.FeedMappingErrorH\x00\x12g\n\x13\x63ustomer_feed_error\x18] \x01(\x0e\x32H.google.ads.googleads.v16.errors.CustomerFeedErrorEnum.CustomerFeedErrorH\x00\x12\x65\n\x13\x61\x64_group_feed_error\x18^ \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.AdGroupFeedErrorEnum.AdGroupFeedErrorH\x00\x12g\n\x13\x63\x61mpaign_feed_error\x18` \x01(\x0e\x32H.google.ads.googleads.v16.errors.CampaignFeedErrorEnum.CampaignFeedErrorH\x00\x12m\n\x15\x63ustom_interest_error\x18\x61 \x01(\x0e\x32L.google.ads.googleads.v16.errors.CustomInterestErrorEnum.CustomInterestErrorH\x00\x12y\n\x19\x63\x61mpaign_experiment_error\x18\x62 \x01(\x0e\x32T.google.ads.googleads.v16.errors.CampaignExperimentErrorEnum.CampaignExperimentErrorH\x00\x12w\n\x19\x65xtension_feed_item_error\x18\x64 \x01(\x0e\x32R.google.ads.googleads.v16.errors.ExtensionFeedItemErrorEnum.ExtensionFeedItemErrorH\x00\x12\x64\n\x12\x61\x64_parameter_error\x18\x65 \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.AdParameterErrorEnum.AdParameterErrorH\x00\x12z\n\x1a\x66\x65\x65\x64_item_validation_error\x18\x66 \x01(\x0e\x32T.google.ads.googleads.v16.errors.FeedItemValidationErrorEnum.FeedItemValidationErrorH\x00\x12s\n\x17\x65xtension_setting_error\x18g \x01(\x0e\x32P.google.ads.googleads.v16.errors.ExtensionSettingErrorEnum.ExtensionSettingErrorH\x00\x12\x66\n\x13\x66\x65\x65\x64_item_set_error\x18\x8c\x01 \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.FeedItemSetErrorEnum.FeedItemSetErrorH\x00\x12s\n\x18\x66\x65\x65\x64_item_set_link_error\x18\x8d\x01 \x01(\x0e\x32N.google.ads.googleads.v16.errors.FeedItemSetLinkErrorEnum.FeedItemSetLinkErrorH\x00\x12n\n\x16\x66\x65\x65\x64_item_target_error\x18h \x01(\x0e\x32L.google.ads.googleads.v16.errors.FeedItemTargetErrorEnum.FeedItemTargetErrorH\x00\x12p\n\x16policy_violation_error\x18i \x01(\x0e\x32N.google.ads.googleads.v16.errors.PolicyViolationErrorEnum.PolicyViolationErrorH\x00\x12m\n\x15partial_failure_error\x18p \x01(\x0e\x32L.google.ads.googleads.v16.errors.PartialFailureErrorEnum.PartialFailureErrorH\x00\x12\x8f\x01\n!policy_validation_parameter_error\x18r \x01(\x0e\x32\x62.google.ads.googleads.v16.errors.PolicyValidationParameterErrorEnum.PolicyValidationParameterErrorH\x00\x12^\n\x10size_limit_error\x18v \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.SizeLimitErrorEnum.SizeLimitErrorH\x00\x12{\n\x1boffline_user_data_job_error\x18w \x01(\x0e\x32T.google.ads.googleads.v16.errors.OfflineUserDataJobErrorEnum.OfflineUserDataJobErrorH\x00\x12n\n\x15not_allowlisted_error\x18\x89\x01 \x01(\x0e\x32L.google.ads.googleads.v16.errors.NotAllowlistedErrorEnum.NotAllowlistedErrorH\x00\x12\x64\n\x12manager_link_error\x18y \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.ManagerLinkErrorEnum.ManagerLinkErrorH\x00\x12g\n\x13\x63urrency_code_error\x18z \x01(\x0e\x32H.google.ads.googleads.v16.errors.CurrencyCodeErrorEnum.CurrencyCodeErrorH\x00\x12`\n\x10\x65xperiment_error\x18{ \x01(\x0e\x32\x44.google.ads.googleads.v16.errors.ExperimentErrorEnum.ExperimentErrorH\x00\x12s\n\x17\x61\x63\x63\x65ss_invitation_error\x18| \x01(\x0e\x32P.google.ads.googleads.v16.errors.AccessInvitationErrorEnum.AccessInvitationErrorH\x00\x12^\n\x10reach_plan_error\x18} \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.ReachPlanErrorEnum.ReachPlanErrorH\x00\x12W\n\rinvoice_error\x18~ \x01(\x0e\x32>.google.ads.googleads.v16.errors.InvoiceErrorEnum.InvoiceErrorH\x00\x12p\n\x16payments_account_error\x18\x7f \x01(\x0e\x32N.google.ads.googleads.v16.errors.PaymentsAccountErrorEnum.PaymentsAccountErrorH\x00\x12\\\n\x0ftime_zone_error\x18\x80\x01 \x01(\x0e\x32@.google.ads.googleads.v16.errors.TimeZoneErrorEnum.TimeZoneErrorH\x00\x12_\n\x10\x61sset_link_error\x18\x81\x01 \x01(\x0e\x32\x42.google.ads.googleads.v16.errors.AssetLinkErrorEnum.AssetLinkErrorH\x00\x12\\\n\x0fuser_data_error\x18\x82\x01 \x01(\x0e\x32@.google.ads.googleads.v16.errors.UserDataErrorEnum.UserDataErrorH\x00\x12\\\n\x0f\x62\x61tch_job_error\x18\x83\x01 \x01(\x0e\x32@.google.ads.googleads.v16.errors.BatchJobErrorEnum.BatchJobErrorH\x00\x12\x65\n\x12\x61\x63\x63ount_link_error\x18\x86\x01 \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.AccountLinkErrorEnum.AccountLinkErrorH\x00\x12\x95\x01\n$third_party_app_analytics_link_error\x18\x87\x01 \x01(\x0e\x32\x64.google.ads.googleads.v16.errors.ThirdPartyAppAnalyticsLinkErrorEnum.ThirdPartyAppAnalyticsLinkErrorH\x00\x12{\n\x1a\x63ustomer_user_access_error\x18\x8a\x01 \x01(\x0e\x32T.google.ads.googleads.v16.errors.CustomerUserAccessErrorEnum.CustomerUserAccessErrorH\x00\x12n\n\x15\x63ustom_audience_error\x18\x8b\x01 \x01(\x0e\x32L.google.ads.googleads.v16.errors.CustomAudienceErrorEnum.CustomAudienceErrorH\x00\x12[\n\x0e\x61udience_error\x18\xa4\x01 \x01(\x0e\x32@.google.ads.googleads.v16.errors.AudienceErrorEnum.AudienceErrorH\x00\x12x\n\x19search_term_insight_error\x18\xae\x01 \x01(\x0e\x32R.google.ads.googleads.v16.errors.SearchTermInsightErrorEnum.SearchTermInsightErrorH\x00\x12k\n\x14smart_campaign_error\x18\x93\x01 \x01(\x0e\x32J.google.ads.googleads.v16.errors.SmartCampaignErrorEnum.SmartCampaignErrorH\x00\x12k\n\x14\x65xperiment_arm_error\x18\x9c\x01 \x01(\x0e\x32J.google.ads.googleads.v16.errors.ExperimentArmErrorEnum.ExperimentArmErrorH\x00\x12t\n\x17\x61udience_insights_error\x18\xa7\x01 \x01(\x0e\x32P.google.ads.googleads.v16.errors.AudienceInsightsErrorEnum.AudienceInsightsErrorH\x00\x12\x65\n\x12product_link_error\x18\xa9\x01 \x01(\x0e\x32\x46.google.ads.googleads.v16.errors.ProductLinkErrorEnum.ProductLinkErrorH\x00\x12\xc2\x01\n4customer_sk_ad_network_conversion_value_schema_error\x18\xaa\x01 \x01(\x0e\x32\x80\x01.google.ads.googleads.v16.errors.CustomerSkAdNetworkConversionValueSchemaErrorEnum.CustomerSkAdNetworkConversionValueSchemaErrorH\x00\x12[\n\x0e\x63urrency_error\x18\xab\x01 \x01(\x0e\x32@.google.ads.googleads.v16.errors.CurrencyErrorEnum.CurrencyErrorH\x00\x12u\n\x18\x61sset_group_signal_error\x18\xb0\x01 \x01(\x0e\x32P.google.ads.googleads.v16.errors.AssetGroupSignalErrorEnum.AssetGroupSignalErrorH\x00\x12\x84\x01\n\x1dproduct_link_invitation_error\x18\xb1\x01 \x01(\x0e\x32Z.google.ads.googleads.v16.errors.ProductLinkInvitationErrorEnum.ProductLinkInvitationErrorH\x00\x12\x84\x01\n\x1d\x63ustomer_lifecycle_goal_error\x18\xb2\x01 \x01(\x0e\x32Z.google.ads.googleads.v16.errors.CustomerLifecycleGoalErrorEnum.CustomerLifecycleGoalErrorH\x00\x12\x84\x01\n\x1d\x63\x61mpaign_lifecycle_goal_error\x18\xb3\x01 \x01(\x0e\x32Z.google.ads.googleads.v16.errors.CampaignLifecycleGoalErrorEnum.CampaignLifecycleGoalErrorH\x00\x12\x80\x01\n\x1bidentity_verification_error\x18\xb5\x01 \x01(\x0e\x32X.google.ads.googleads.v16.errors.IdentityVerificationErrorEnum.IdentityVerificationErrorH\x00\x42\x0c\n\nerror_code\"\xb3\x01\n\rErrorLocation\x12\\\n\x13\x66ield_path_elements\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.errors.ErrorLocation.FieldPathElement\x1a\x44\n\x10\x46ieldPathElement\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x12\n\x05index\x18\x03 \x01(\x05H\x00\x88\x01\x01\x42\x08\n\x06_index\"\x88\x03\n\x0c\x45rrorDetails\x12\x1e\n\x16unpublished_error_code\x18\x01 \x01(\t\x12Y\n\x18policy_violation_details\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.errors.PolicyViolationDetails\x12U\n\x16policy_finding_details\x18\x03 \x01(\x0b\x32\x35.google.ads.googleads.v16.errors.PolicyFindingDetails\x12O\n\x13quota_error_details\x18\x04 \x01(\x0b\x32\x32.google.ads.googleads.v16.errors.QuotaErrorDetails\x12U\n\x16resource_count_details\x18\x05 \x01(\x0b\x32\x35.google.ads.googleads.v16.errors.ResourceCountDetails\"\xb4\x01\n\x16PolicyViolationDetails\x12#\n\x1b\x65xternal_policy_description\x18\x02 \x01(\t\x12@\n\x03key\x18\x04 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.PolicyViolationKey\x12\x1c\n\x14\x65xternal_policy_name\x18\x05 \x01(\t\x12\x15\n\ris_exemptible\x18\x06 \x01(\x08\"g\n\x14PolicyFindingDetails\x12O\n\x14policy_topic_entries\x18\x01 \x03(\x0b\x32\x31.google.ads.googleads.v16.common.PolicyTopicEntry\"\xf9\x01\n\x11QuotaErrorDetails\x12U\n\nrate_scope\x18\x01 \x01(\x0e\x32\x41.google.ads.googleads.v16.errors.QuotaErrorDetails.QuotaRateScope\x12\x11\n\trate_name\x18\x02 \x01(\t\x12.\n\x0bretry_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\"J\n\x0eQuotaRateScope\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07\x41\x43\x43OUNT\x10\x02\x12\r\n\tDEVELOPER\x10\x03\"\xcc\x01\n\x14ResourceCountDetails\x12\x14\n\x0c\x65nclosing_id\x18\x01 \x01(\t\x12\x1a\n\x12\x65nclosing_resource\x18\x05 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12[\n\nlimit_type\x18\x03 \x01(\x0e\x32G.google.ads.googleads.v16.enums.ResourceLimitTypeEnum.ResourceLimitType\x12\x16\n\x0e\x65xisting_count\x18\x04 \x01(\x05\x42\xeb\x01\n#com.google.ads.googleads.v16.errorsB\x0b\x45rrorsProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.Value", "google/ads/googleads/v16/common/value.proto"], + ["google.ads.googleads.v16.common.PolicyViolationKey", "google/ads/googleads/v16/common/policy.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + GoogleAdsFailure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.GoogleAdsFailure").msgclass + GoogleAdsError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.GoogleAdsError").msgclass + ErrorCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ErrorCode").msgclass + ErrorLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ErrorLocation").msgclass + ErrorLocation::FieldPathElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ErrorLocation.FieldPathElement").msgclass + ErrorDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ErrorDetails").msgclass + PolicyViolationDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.PolicyViolationDetails").msgclass + PolicyFindingDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.PolicyFindingDetails").msgclass + QuotaErrorDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.QuotaErrorDetails").msgclass + QuotaErrorDetails::QuotaRateScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.QuotaErrorDetails.QuotaRateScope").enummodule + ResourceCountDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ResourceCountDetails").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/experiment_arm_error_pb.rb b/lib/google/ads/google_ads/v16/errors/experiment_arm_error_pb.rb new file mode 100644 index 000000000..7a52099ef --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/experiment_arm_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/experiment_arm_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/ads/googleads/v16/errors/experiment_arm_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xb1\x05\n\x16\x45xperimentArmErrorEnum\"\x96\x05\n\x12\x45xperimentArmError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\'\n#EXPERIMENT_ARM_COUNT_LIMIT_EXCEEDED\x10\x02\x12\x1b\n\x17INVALID_CAMPAIGN_STATUS\x10\x03\x12!\n\x1d\x44UPLICATE_EXPERIMENT_ARM_NAME\x10\x04\x12%\n!CANNOT_SET_TREATMENT_ARM_CAMPAIGN\x10\x05\x12\x1e\n\x1a\x43\x41NNOT_MODIFY_CAMPAIGN_IDS\x10\x06\x12-\n)CANNOT_MODIFY_CAMPAIGN_WITHOUT_SUFFIX_SET\x10\x07\x12+\n\'CANNOT_MUTATE_TRAFFIC_SPLIT_AFTER_START\x10\x08\x12*\n&CANNOT_ADD_CAMPAIGN_WITH_SHARED_BUDGET\x10\t\x12*\n&CANNOT_ADD_CAMPAIGN_WITH_CUSTOM_BUDGET\x10\n\x12\x34\n0CANNOT_ADD_CAMPAIGNS_WITH_DYNAMIC_ASSETS_ENABLED\x10\x0b\x12\x35\n1UNSUPPORTED_CAMPAIGN_ADVERTISING_CHANNEL_SUB_TYPE\x10\x0c\x12,\n(CANNOT_ADD_BASE_CAMPAIGN_WITH_DATE_RANGE\x10\r\x12\x31\n-BIDDING_STRATEGY_NOT_SUPPORTED_IN_EXPERIMENTS\x10\x0e\x12\x30\n,TRAFFIC_SPLIT_NOT_SUPPORTED_FOR_CHANNEL_TYPE\x10\x0f\x42\xf7\x01\n#com.google.ads.googleads.v16.errorsB\x17\x45xperimentArmErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ExperimentArmErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ExperimentArmErrorEnum").msgclass + ExperimentArmErrorEnum::ExperimentArmError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ExperimentArmErrorEnum.ExperimentArmError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/experiment_error_pb.rb b/lib/google/ads/google_ads/v16/errors/experiment_error_pb.rb new file mode 100644 index 000000000..d71207c47 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/experiment_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/experiment_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/ads/googleads/v16/errors/experiment_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x80\t\n\x13\x45xperimentErrorEnum\"\xe8\x08\n\x0f\x45xperimentError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12!\n\x1d\x43\x41NNOT_SET_START_DATE_IN_PAST\x10\x02\x12\x1e\n\x1a\x45ND_DATE_BEFORE_START_DATE\x10\x03\x12 \n\x1cSTART_DATE_TOO_FAR_IN_FUTURE\x10\x04\x12\x1d\n\x19\x44UPLICATE_EXPERIMENT_NAME\x10\x05\x12$\n CANNOT_MODIFY_REMOVED_EXPERIMENT\x10\x06\x12\x1d\n\x19START_DATE_ALREADY_PASSED\x10\x07\x12\x1f\n\x1b\x43\x41NNOT_SET_END_DATE_IN_PAST\x10\x08\x12 \n\x1c\x43\x41NNOT_SET_STATUS_TO_REMOVED\x10\t\x12\x1f\n\x1b\x43\x41NNOT_MODIFY_PAST_END_DATE\x10\n\x12\x12\n\x0eINVALID_STATUS\x10\x0b\x12!\n\x1dINVALID_CAMPAIGN_CHANNEL_TYPE\x10\x0c\x12&\n\"OVERLAPPING_MEMBERS_AND_DATE_RANGE\x10\r\x12#\n\x1fINVALID_TRIAL_ARM_TRAFFIC_SPLIT\x10\x0e\x12\x1d\n\x19TRAFFIC_SPLIT_OVERLAPPING\x10\x0f\x12\x45\nASUM_TRIAL_ARM_TRAFFIC_UNEQUALS_TO_TRIAL_TRAFFIC_SPLIT_DENOMINATOR\x10\x10\x12+\n\'CANNOT_MODIFY_TRAFFIC_SPLIT_AFTER_START\x10\x11\x12\x18\n\x14\x45XPERIMENT_NOT_FOUND\x10\x12\x12\x1e\n\x1a\x45XPERIMENT_NOT_YET_STARTED\x10\x13\x12%\n!CANNOT_HAVE_MULTIPLE_CONTROL_ARMS\x10\x14\x12\x1f\n\x1bIN_DESIGN_CAMPAIGNS_NOT_SET\x10\x15\x12\"\n\x1e\x43\x41NNOT_SET_STATUS_TO_GRADUATED\x10\x16\x12\x38\n4CANNOT_CREATE_EXPERIMENT_CAMPAIGN_WITH_SHARED_BUDGET\x10\x17\x12\x38\n4CANNOT_CREATE_EXPERIMENT_CAMPAIGN_WITH_CUSTOM_BUDGET\x10\x18\x12\x1d\n\x19STATUS_TRANSITION_INVALID\x10\x19\x12&\n\"DUPLICATE_EXPERIMENT_CAMPAIGN_NAME\x10\x1a\x12(\n$CANNOT_REMOVE_IN_CREATION_EXPERIMENT\x10\x1b\x12\x30\n,CANNOT_ADD_CAMPAIGN_WITH_DEPRECATED_AD_TYPES\x10\x1c\x12\x36\n2CANNOT_ENABLE_SYNC_FOR_UNSUPPORTED_EXPERIMENT_TYPE\x10\x1d\x42\xf4\x01\n#com.google.ads.googleads.v16.errorsB\x14\x45xperimentErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ExperimentErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ExperimentErrorEnum").msgclass + ExperimentErrorEnum::ExperimentError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ExperimentErrorEnum.ExperimentError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/extension_feed_item_error_pb.rb b/lib/google/ads/google_ads/v16/errors/extension_feed_item_error_pb.rb new file mode 100644 index 000000000..45e159b31 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/extension_feed_item_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/extension_feed_item_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n?google/ads/googleads/v16/errors/extension_feed_item_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xf6\r\n\x1a\x45xtensionFeedItemErrorEnum\"\xd7\r\n\x16\x45xtensionFeedItemError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x16\n\x12VALUE_OUT_OF_RANGE\x10\x02\x12\x15\n\x11URL_LIST_TOO_LONG\x10\x03\x12\x32\n.CANNOT_HAVE_RESTRICTION_ON_EMPTY_GEO_TARGETING\x10\x04\x12\x1e\n\x1a\x43\x41NNOT_SET_WITH_FINAL_URLS\x10\x05\x12!\n\x1d\x43\x41NNOT_SET_WITHOUT_FINAL_URLS\x10\x06\x12\x18\n\x14INVALID_PHONE_NUMBER\x10\x07\x12*\n&PHONE_NUMBER_NOT_SUPPORTED_FOR_COUNTRY\x10\x08\x12-\n)CARRIER_SPECIFIC_SHORT_NUMBER_NOT_ALLOWED\x10\t\x12#\n\x1fPREMIUM_RATE_NUMBER_NOT_ALLOWED\x10\n\x12\x1a\n\x16\x44ISALLOWED_NUMBER_TYPE\x10\x0b\x12(\n$INVALID_DOMESTIC_PHONE_NUMBER_FORMAT\x10\x0c\x12#\n\x1fVANITY_PHONE_NUMBER_NOT_ALLOWED\x10\r\x12\"\n\x1eINVALID_CALL_CONVERSION_ACTION\x10\x0e\x12.\n*CUSTOMER_NOT_ON_ALLOWLIST_FOR_CALLTRACKING\x10/\x12*\n&CALLTRACKING_NOT_SUPPORTED_FOR_COUNTRY\x10\x10\x12\x30\n,CUSTOMER_CONSENT_FOR_CALL_RECORDING_REQUIRED\x10\x11\x12\x12\n\x0eINVALID_APP_ID\x10\x12\x12&\n\"QUOTES_IN_REVIEW_EXTENSION_SNIPPET\x10\x13\x12\'\n#HYPHENS_IN_REVIEW_EXTENSION_SNIPPET\x10\x14\x12&\n\"REVIEW_EXTENSION_SOURCE_INELIGIBLE\x10\x15\x12(\n$SOURCE_NAME_IN_REVIEW_EXTENSION_TEXT\x10\x16\x12\x1f\n\x1bINCONSISTENT_CURRENCY_CODES\x10\x17\x12*\n&PRICE_EXTENSION_HAS_DUPLICATED_HEADERS\x10\x18\x12\x34\n0PRICE_ITEM_HAS_DUPLICATED_HEADER_AND_DESCRIPTION\x10\x19\x12%\n!PRICE_EXTENSION_HAS_TOO_FEW_ITEMS\x10\x1a\x12&\n\"PRICE_EXTENSION_HAS_TOO_MANY_ITEMS\x10\x1b\x12\x15\n\x11UNSUPPORTED_VALUE\x10\x1c\x12*\n&UNSUPPORTED_VALUE_IN_SELECTED_LANGUAGE\x10\x1d\x12\x1d\n\x19INVALID_DEVICE_PREFERENCE\x10\x1e\x12\x18\n\x14INVALID_SCHEDULE_END\x10\x1f\x12*\n&DATE_TIME_MUST_BE_IN_ACCOUNT_TIME_ZONE\x10 \x12\x1b\n\x17INVALID_SNIPPETS_HEADER\x10!\x12\'\n#CANNOT_OPERATE_ON_REMOVED_FEED_ITEM\x10\"\x12<\n8PHONE_NUMBER_NOT_SUPPORTED_WITH_CALLTRACKING_FOR_COUNTRY\x10#\x12(\n$CONFLICTING_CALL_CONVERSION_SETTINGS\x10$\x12\x1b\n\x17\x45XTENSION_TYPE_MISMATCH\x10%\x12\x1e\n\x1a\x45XTENSION_SUBTYPE_REQUIRED\x10&\x12\x1e\n\x1a\x45XTENSION_TYPE_UNSUPPORTED\x10\'\x12\x31\n-CANNOT_OPERATE_ON_FEED_WITH_MULTIPLE_MAPPINGS\x10(\x12.\n*CANNOT_OPERATE_ON_FEED_WITH_KEY_ATTRIBUTES\x10)\x12\x18\n\x14INVALID_PRICE_FORMAT\x10*\x12\x1a\n\x16PROMOTION_INVALID_TIME\x10+\x12%\n!TOO_MANY_DECIMAL_PLACES_SPECIFIED\x10,\x12$\n CONCRETE_EXTENSION_TYPE_REQUIRED\x10-\x12 \n\x1cSCHEDULE_END_NOT_AFTER_START\x10.B\xfb\x01\n#com.google.ads.googleads.v16.errorsB\x1b\x45xtensionFeedItemErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ExtensionFeedItemErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ExtensionFeedItemErrorEnum").msgclass + ExtensionFeedItemErrorEnum::ExtensionFeedItemError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ExtensionFeedItemErrorEnum.ExtensionFeedItemError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/extension_setting_error_pb.rb b/lib/google/ads/google_ads/v16/errors/extension_setting_error_pb.rb new file mode 100644 index 000000000..26e603ba5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/extension_setting_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/extension_setting_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n=google/ads/googleads/v16/errors/extension_setting_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xae\x14\n\x19\x45xtensionSettingErrorEnum\"\x90\x14\n\x15\x45xtensionSettingError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x17\n\x13\x45XTENSIONS_REQUIRED\x10\x02\x12%\n!FEED_TYPE_EXTENSION_TYPE_MISMATCH\x10\x03\x12\x15\n\x11INVALID_FEED_TYPE\x10\x04\x12\x34\n0INVALID_FEED_TYPE_FOR_CUSTOMER_EXTENSION_SETTING\x10\x05\x12%\n!CANNOT_CHANGE_FEED_ITEM_ON_CREATE\x10\x06\x12)\n%CANNOT_UPDATE_NEWLY_CREATED_EXTENSION\x10\x07\x12\x33\n/NO_EXISTING_AD_GROUP_EXTENSION_SETTING_FOR_TYPE\x10\x08\x12\x33\n/NO_EXISTING_CAMPAIGN_EXTENSION_SETTING_FOR_TYPE\x10\t\x12\x33\n/NO_EXISTING_CUSTOMER_EXTENSION_SETTING_FOR_TYPE\x10\n\x12-\n)AD_GROUP_EXTENSION_SETTING_ALREADY_EXISTS\x10\x0b\x12-\n)CAMPAIGN_EXTENSION_SETTING_ALREADY_EXISTS\x10\x0c\x12-\n)CUSTOMER_EXTENSION_SETTING_ALREADY_EXISTS\x10\r\x12\x35\n1AD_GROUP_FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE\x10\x0e\x12\x35\n1CAMPAIGN_FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE\x10\x0f\x12\x35\n1CUSTOMER_FEED_ALREADY_EXISTS_FOR_PLACEHOLDER_TYPE\x10\x10\x12\x16\n\x12VALUE_OUT_OF_RANGE\x10\x11\x12$\n CANNOT_SET_FIELD_WITH_FINAL_URLS\x10\x12\x12\x16\n\x12\x46INAL_URLS_NOT_SET\x10\x13\x12\x18\n\x14INVALID_PHONE_NUMBER\x10\x14\x12*\n&PHONE_NUMBER_NOT_SUPPORTED_FOR_COUNTRY\x10\x15\x12-\n)CARRIER_SPECIFIC_SHORT_NUMBER_NOT_ALLOWED\x10\x16\x12#\n\x1fPREMIUM_RATE_NUMBER_NOT_ALLOWED\x10\x17\x12\x1a\n\x16\x44ISALLOWED_NUMBER_TYPE\x10\x18\x12(\n$INVALID_DOMESTIC_PHONE_NUMBER_FORMAT\x10\x19\x12#\n\x1fVANITY_PHONE_NUMBER_NOT_ALLOWED\x10\x1a\x12\x18\n\x14INVALID_COUNTRY_CODE\x10\x1b\x12#\n\x1fINVALID_CALL_CONVERSION_TYPE_ID\x10\x1c\x12.\n*CUSTOMER_NOT_IN_ALLOWLIST_FOR_CALLTRACKING\x10\x45\x12*\n&CALLTRACKING_NOT_SUPPORTED_FOR_COUNTRY\x10\x1e\x12\x12\n\x0eINVALID_APP_ID\x10\x1f\x12&\n\"QUOTES_IN_REVIEW_EXTENSION_SNIPPET\x10 \x12\'\n#HYPHENS_IN_REVIEW_EXTENSION_SNIPPET\x10!\x12(\n$REVIEW_EXTENSION_SOURCE_NOT_ELIGIBLE\x10\"\x12(\n$SOURCE_NAME_IN_REVIEW_EXTENSION_TEXT\x10#\x12\x11\n\rMISSING_FIELD\x10$\x12\x1f\n\x1bINCONSISTENT_CURRENCY_CODES\x10%\x12*\n&PRICE_EXTENSION_HAS_DUPLICATED_HEADERS\x10&\x12\x34\n0PRICE_ITEM_HAS_DUPLICATED_HEADER_AND_DESCRIPTION\x10\'\x12%\n!PRICE_EXTENSION_HAS_TOO_FEW_ITEMS\x10(\x12&\n\"PRICE_EXTENSION_HAS_TOO_MANY_ITEMS\x10)\x12\x15\n\x11UNSUPPORTED_VALUE\x10*\x12\x1d\n\x19INVALID_DEVICE_PREFERENCE\x10+\x12\x18\n\x14INVALID_SCHEDULE_END\x10-\x12*\n&DATE_TIME_MUST_BE_IN_ACCOUNT_TIME_ZONE\x10/\x12%\n!OVERLAPPING_SCHEDULES_NOT_ALLOWED\x10\x30\x12 \n\x1cSCHEDULE_END_NOT_AFTER_START\x10\x31\x12\x1e\n\x1aTOO_MANY_SCHEDULES_PER_DAY\x10\x32\x12&\n\"DUPLICATE_EXTENSION_FEED_ITEM_EDIT\x10\x33\x12\x1b\n\x17INVALID_SNIPPETS_HEADER\x10\x34\x12<\n8PHONE_NUMBER_NOT_SUPPORTED_WITH_CALLTRACKING_FOR_COUNTRY\x10\x35\x12\x1f\n\x1b\x43\x41MPAIGN_TARGETING_MISMATCH\x10\x36\x12\"\n\x1e\x43\x41NNOT_OPERATE_ON_REMOVED_FEED\x10\x37\x12\x1b\n\x17\x45XTENSION_TYPE_REQUIRED\x10\x38\x12-\n)INCOMPATIBLE_UNDERLYING_MATCHING_FUNCTION\x10\x39\x12\x1d\n\x19START_DATE_AFTER_END_DATE\x10:\x12\x18\n\x14INVALID_PRICE_FORMAT\x10;\x12\x1a\n\x16PROMOTION_INVALID_TIME\x10<\x12<\n8PROMOTION_CANNOT_SET_PERCENT_DISCOUNT_AND_MONEY_DISCOUNT\x10=\x12>\n:PROMOTION_CANNOT_SET_PROMOTION_CODE_AND_ORDERS_OVER_AMOUNT\x10>\x12%\n!TOO_MANY_DECIMAL_PLACES_SPECIFIED\x10?\x12\x19\n\x15INVALID_LANGUAGE_CODE\x10@\x12\x18\n\x14UNSUPPORTED_LANGUAGE\x10\x41\x12\x30\n,CUSTOMER_CONSENT_FOR_CALL_RECORDING_REQUIRED\x10\x42\x12&\n\"EXTENSION_SETTING_UPDATE_IS_A_NOOP\x10\x43\x12\x13\n\x0f\x44ISALLOWED_TEXT\x10\x44\x42\xfa\x01\n#com.google.ads.googleads.v16.errorsB\x1a\x45xtensionSettingErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ExtensionSettingErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ExtensionSettingErrorEnum").msgclass + ExtensionSettingErrorEnum::ExtensionSettingError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ExtensionSettingErrorEnum.ExtensionSettingError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/feed_attribute_reference_error_pb.rb b/lib/google/ads/google_ads/v16/errors/feed_attribute_reference_error_pb.rb new file mode 100644 index 000000000..0d0359ae8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/feed_attribute_reference_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/feed_attribute_reference_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/errors/feed_attribute_reference_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xba\x01\n\x1f\x46\x65\x65\x64\x41ttributeReferenceErrorEnum\"\x96\x01\n\x1b\x46\x65\x65\x64\x41ttributeReferenceError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12!\n\x1d\x43\x41NNOT_REFERENCE_REMOVED_FEED\x10\x02\x12\x15\n\x11INVALID_FEED_NAME\x10\x03\x12\x1f\n\x1bINVALID_FEED_ATTRIBUTE_NAME\x10\x04\x42\x80\x02\n#com.google.ads.googleads.v16.errorsB FeedAttributeReferenceErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FeedAttributeReferenceErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedAttributeReferenceErrorEnum").msgclass + FeedAttributeReferenceErrorEnum::FeedAttributeReferenceError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedAttributeReferenceErrorEnum.FeedAttributeReferenceError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/feed_error_pb.rb b/lib/google/ads/google_ads/v16/errors/feed_error_pb.rb new file mode 100644 index 000000000..48748e1d7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/feed_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/feed_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/ads/googleads/v16/errors/feed_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xeb\x06\n\rFeedErrorEnum\"\xd9\x06\n\tFeedError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1e\n\x1a\x41TTRIBUTE_NAMES_NOT_UNIQUE\x10\x02\x12/\n+ATTRIBUTES_DO_NOT_MATCH_EXISTING_ATTRIBUTES\x10\x03\x12.\n*CANNOT_SPECIFY_USER_ORIGIN_FOR_SYSTEM_FEED\x10\x04\x12\x34\n0CANNOT_SPECIFY_GOOGLE_ORIGIN_FOR_NON_SYSTEM_FEED\x10\x05\x12\x32\n.CANNOT_SPECIFY_FEED_ATTRIBUTES_FOR_SYSTEM_FEED\x10\x06\x12\x34\n0CANNOT_UPDATE_FEED_ATTRIBUTES_WITH_ORIGIN_GOOGLE\x10\x07\x12\x10\n\x0c\x46\x45\x45\x44_REMOVED\x10\x08\x12\x18\n\x14INVALID_ORIGIN_VALUE\x10\t\x12\x1b\n\x17\x46\x45\x45\x44_ORIGIN_IS_NOT_USER\x10\n\x12 \n\x1cINVALID_AUTH_TOKEN_FOR_EMAIL\x10\x0b\x12\x11\n\rINVALID_EMAIL\x10\x0c\x12\x17\n\x13\x44UPLICATE_FEED_NAME\x10\r\x12\x15\n\x11INVALID_FEED_NAME\x10\x0e\x12\x16\n\x12MISSING_OAUTH_INFO\x10\x0f\x12.\n*NEW_ATTRIBUTE_CANNOT_BE_PART_OF_UNIQUE_KEY\x10\x10\x12\x17\n\x13TOO_MANY_ATTRIBUTES\x10\x11\x12\x1c\n\x18INVALID_BUSINESS_ACCOUNT\x10\x12\x12\x33\n/BUSINESS_ACCOUNT_CANNOT_ACCESS_LOCATION_ACCOUNT\x10\x13\x12\x1e\n\x1aINVALID_AFFILIATE_CHAIN_ID\x10\x14\x12\x19\n\x15\x44UPLICATE_SYSTEM_FEED\x10\x15\x12\x14\n\x10GMB_ACCESS_ERROR\x10\x16\x12\x35\n1CANNOT_HAVE_LOCATION_AND_AFFILIATE_LOCATION_FEEDS\x10\x17\x12#\n\x1fLEGACY_EXTENSION_TYPE_READ_ONLY\x10\x18\x42\xee\x01\n#com.google.ads.googleads.v16.errorsB\x0e\x46\x65\x65\x64\x45rrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FeedErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedErrorEnum").msgclass + FeedErrorEnum::FeedError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedErrorEnum.FeedError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/feed_item_error_pb.rb b/lib/google/ads/google_ads/v16/errors/feed_item_error_pb.rb new file mode 100644 index 000000000..db99b23ba --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/feed_item_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/feed_item_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n5google/ads/googleads/v16/errors/feed_item_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xa7\x03\n\x11\x46\x65\x65\x64ItemErrorEnum\"\x91\x03\n\rFeedItemError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12.\n*CANNOT_CONVERT_ATTRIBUTE_VALUE_FROM_STRING\x10\x02\x12\'\n#CANNOT_OPERATE_ON_REMOVED_FEED_ITEM\x10\x03\x12*\n&DATE_TIME_MUST_BE_IN_ACCOUNT_TIME_ZONE\x10\x04\x12\x1c\n\x18KEY_ATTRIBUTES_NOT_FOUND\x10\x05\x12\x0f\n\x0bINVALID_URL\x10\x06\x12\x1a\n\x16MISSING_KEY_ATTRIBUTES\x10\x07\x12\x1d\n\x19KEY_ATTRIBUTES_NOT_UNIQUE\x10\x08\x12%\n!CANNOT_MODIFY_KEY_ATTRIBUTE_VALUE\x10\t\x12,\n(SIZE_TOO_LARGE_FOR_MULTI_VALUE_ATTRIBUTE\x10\n\x12\x1e\n\x1aLEGACY_FEED_TYPE_READ_ONLY\x10\x0b\x42\xf2\x01\n#com.google.ads.googleads.v16.errorsB\x12\x46\x65\x65\x64ItemErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FeedItemErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedItemErrorEnum").msgclass + FeedItemErrorEnum::FeedItemError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedItemErrorEnum.FeedItemError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/feed_item_set_error_pb.rb b/lib/google/ads/google_ads/v16/errors/feed_item_set_error_pb.rb new file mode 100644 index 000000000..c18f336cc --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/feed_item_set_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/feed_item_set_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n9google/ads/googleads/v16/errors/feed_item_set_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xa0\x02\n\x14\x46\x65\x65\x64ItemSetErrorEnum\"\x87\x02\n\x10\x46\x65\x65\x64ItemSetError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x19\n\x15\x46\x45\x45\x44_ITEM_SET_REMOVED\x10\x02\x12\x1f\n\x1b\x43\x41NNOT_CLEAR_DYNAMIC_FILTER\x10\x03\x12 \n\x1c\x43\x41NNOT_CREATE_DYNAMIC_FILTER\x10\x04\x12\x15\n\x11INVALID_FEED_TYPE\x10\x05\x12\x12\n\x0e\x44UPLICATE_NAME\x10\x06\x12&\n\"WRONG_DYNAMIC_FILTER_FOR_FEED_TYPE\x10\x07\x12$\n DYNAMIC_FILTER_INVALID_CHAIN_IDS\x10\x08\x42\xf5\x01\n#com.google.ads.googleads.v16.errorsB\x15\x46\x65\x65\x64ItemSetErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FeedItemSetErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedItemSetErrorEnum").msgclass + FeedItemSetErrorEnum::FeedItemSetError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedItemSetErrorEnum.FeedItemSetError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/feed_item_set_link_error_pb.rb b/lib/google/ads/google_ads/v16/errors/feed_item_set_link_error_pb.rb new file mode 100644 index 000000000..e7698344d --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/feed_item_set_link_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/feed_item_set_link_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n>google/ads/googleads/v16/errors/feed_item_set_link_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x8d\x01\n\x18\x46\x65\x65\x64ItemSetLinkErrorEnum\"q\n\x14\x46\x65\x65\x64ItemSetLinkError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x14\n\x10\x46\x45\x45\x44_ID_MISMATCH\x10\x02\x12%\n!NO_MUTATE_ALLOWED_FOR_DYNAMIC_SET\x10\x03\x42\xf9\x01\n#com.google.ads.googleads.v16.errorsB\x19\x46\x65\x65\x64ItemSetLinkErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FeedItemSetLinkErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedItemSetLinkErrorEnum").msgclass + FeedItemSetLinkErrorEnum::FeedItemSetLinkError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedItemSetLinkErrorEnum.FeedItemSetLinkError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/feed_item_target_error_pb.rb b/lib/google/ads/google_ads/v16/errors/feed_item_target_error_pb.rb new file mode 100644 index 000000000..99e3765da --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/feed_item_target_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/feed_item_target_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n\x12*\n&PRICE_EXTENSION_HAS_DUPLICATED_HEADERS\x10?\x12.\n*ITEM_HAS_DUPLICATED_HEADER_AND_DESCRIPTION\x10@\x12%\n!PRICE_EXTENSION_HAS_TOO_FEW_ITEMS\x10\x41\x12\x15\n\x11UNSUPPORTED_VALUE\x10\x42\x12\x1c\n\x18INVALID_FINAL_MOBILE_URL\x10\x43\x12%\n!INVALID_KEYWORDLESS_AD_RULE_LABEL\x10\x44\x12\'\n#VALUE_TRACK_PARAMETER_NOT_SUPPORTED\x10\x45\x12*\n&UNSUPPORTED_VALUE_IN_SELECTED_LANGUAGE\x10\x46\x12\x18\n\x14INVALID_IOS_APP_LINK\x10G\x12,\n(MISSING_IOS_APP_LINK_OR_IOS_APP_STORE_ID\x10H\x12\x1a\n\x16PROMOTION_INVALID_TIME\x10I\x12\x39\n5PROMOTION_CANNOT_SET_PERCENT_OFF_AND_MONEY_AMOUNT_OFF\x10J\x12>\n:PROMOTION_CANNOT_SET_PROMOTION_CODE_AND_ORDERS_OVER_AMOUNT\x10K\x12%\n!TOO_MANY_DECIMAL_PLACES_SPECIFIED\x10L\x12\x1e\n\x1a\x41\x44_CUSTOMIZERS_NOT_ALLOWED\x10M\x12\x19\n\x15INVALID_LANGUAGE_CODE\x10N\x12\x18\n\x14UNSUPPORTED_LANGUAGE\x10O\x12\x1b\n\x17IF_FUNCTION_NOT_ALLOWED\x10P\x12\x1c\n\x18INVALID_FINAL_URL_SUFFIX\x10Q\x12#\n\x1fINVALID_TAG_IN_FINAL_URL_SUFFIX\x10R\x12#\n\x1fINVALID_FINAL_URL_SUFFIX_FORMAT\x10S\x12\x30\n,CUSTOMER_CONSENT_FOR_CALL_RECORDING_REQUIRED\x10T\x12\'\n#ONLY_ONE_DELIVERY_OPTION_IS_ALLOWED\x10U\x12\x1d\n\x19NO_DELIVERY_OPTION_IS_SET\x10V\x12&\n\"INVALID_CONVERSION_REPORTING_STATE\x10W\x12\x14\n\x10IMAGE_SIZE_WRONG\x10X\x12+\n\'EMAIL_DELIVERY_NOT_AVAILABLE_IN_COUNTRY\x10Y\x12\'\n#AUTO_REPLY_NOT_AVAILABLE_IN_COUNTRY\x10Z\x12\x1a\n\x16INVALID_LATITUDE_VALUE\x10[\x12\x1b\n\x17INVALID_LONGITUDE_VALUE\x10\\\x12\x13\n\x0fTOO_MANY_LABELS\x10]\x12\x15\n\x11INVALID_IMAGE_URL\x10^\x12\x1a\n\x16MISSING_LATITUDE_VALUE\x10_\x12\x1b\n\x17MISSING_LONGITUDE_VALUE\x10`\x12\x15\n\x11\x41\x44\x44RESS_NOT_FOUND\x10\x61\x12\x1a\n\x16\x41\x44\x44RESS_NOT_TARGETABLE\x10\x62\x12\x14\n\x10INVALID_ASSET_ID\x10\x64\x12\x1b\n\x17INCOMPATIBLE_ASSET_TYPE\x10\x65\x12\x1f\n\x1bIMAGE_ERROR_UNEXPECTED_SIZE\x10\x66\x12(\n$IMAGE_ERROR_ASPECT_RATIO_NOT_ALLOWED\x10g\x12\x1e\n\x1aIMAGE_ERROR_FILE_TOO_LARGE\x10h\x12\"\n\x1eIMAGE_ERROR_FORMAT_NOT_ALLOWED\x10i\x12$\n IMAGE_ERROR_CONSTRAINTS_VIOLATED\x10j\x12\x1c\n\x18IMAGE_ERROR_SERVER_ERROR\x10kB\xfc\x01\n#com.google.ads.googleads.v16.errorsB\x1c\x46\x65\x65\x64ItemValidationErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FeedItemValidationErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedItemValidationErrorEnum").msgclass + FeedItemValidationErrorEnum::FeedItemValidationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedItemValidationErrorEnum.FeedItemValidationError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/feed_mapping_error_pb.rb b/lib/google/ads/google_ads/v16/errors/feed_mapping_error_pb.rb new file mode 100644 index 000000000..8fcbe5ad2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/feed_mapping_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/feed_mapping_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/ads/googleads/v16/errors/feed_mapping_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xb2\x06\n\x14\x46\x65\x65\x64MappingErrorEnum\"\x99\x06\n\x10\x46\x65\x65\x64MappingError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1d\n\x19INVALID_PLACEHOLDER_FIELD\x10\x02\x12\x1b\n\x17INVALID_CRITERION_FIELD\x10\x03\x12\x1c\n\x18INVALID_PLACEHOLDER_TYPE\x10\x04\x12\x1a\n\x16INVALID_CRITERION_TYPE\x10\x05\x12\x1f\n\x1bNO_ATTRIBUTE_FIELD_MAPPINGS\x10\x07\x12 \n\x1c\x46\x45\x45\x44_ATTRIBUTE_TYPE_MISMATCH\x10\x08\x12\x38\n4CANNOT_OPERATE_ON_MAPPINGS_FOR_SYSTEM_GENERATED_FEED\x10\t\x12*\n&MULTIPLE_MAPPINGS_FOR_PLACEHOLDER_TYPE\x10\n\x12(\n$MULTIPLE_MAPPINGS_FOR_CRITERION_TYPE\x10\x0b\x12+\n\'MULTIPLE_MAPPINGS_FOR_PLACEHOLDER_FIELD\x10\x0c\x12)\n%MULTIPLE_MAPPINGS_FOR_CRITERION_FIELD\x10\r\x12\'\n#UNEXPECTED_ATTRIBUTE_FIELD_MAPPINGS\x10\x0e\x12.\n*LOCATION_PLACEHOLDER_ONLY_FOR_PLACES_FEEDS\x10\x0f\x12)\n%CANNOT_MODIFY_MAPPINGS_FOR_TYPED_FEED\x10\x10\x12:\n6INVALID_PLACEHOLDER_TYPE_FOR_NON_SYSTEM_GENERATED_FEED\x10\x11\x12;\n7INVALID_PLACEHOLDER_TYPE_FOR_SYSTEM_GENERATED_FEED_TYPE\x10\x12\x12)\n%ATTRIBUTE_FIELD_MAPPING_MISSING_FIELD\x10\x13\x12\x1e\n\x1aLEGACY_FEED_TYPE_READ_ONLY\x10\x14\x42\xf5\x01\n#com.google.ads.googleads.v16.errorsB\x15\x46\x65\x65\x64MappingErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FeedMappingErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedMappingErrorEnum").msgclass + FeedMappingErrorEnum::FeedMappingError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FeedMappingErrorEnum.FeedMappingError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/field_error_pb.rb b/lib/google/ads/google_ads/v16/errors/field_error_pb.rb new file mode 100644 index 000000000..9c7223bb1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/field_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/field_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/ads/googleads/v16/errors/field_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xf7\x01\n\x0e\x46ieldErrorEnum\"\xe4\x01\n\nFieldError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08REQUIRED\x10\x02\x12\x13\n\x0fIMMUTABLE_FIELD\x10\x03\x12\x11\n\rINVALID_VALUE\x10\x04\x12\x17\n\x13VALUE_MUST_BE_UNSET\x10\x05\x12\x1a\n\x16REQUIRED_NONEMPTY_LIST\x10\x06\x12\x1b\n\x17\x46IELD_CANNOT_BE_CLEARED\x10\x07\x12\x11\n\rBLOCKED_VALUE\x10\t\x12\x1d\n\x19\x46IELD_CAN_ONLY_BE_CLEARED\x10\nB\xef\x01\n#com.google.ads.googleads.v16.errorsB\x0f\x46ieldErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FieldErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FieldErrorEnum").msgclass + FieldErrorEnum::FieldError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FieldErrorEnum.FieldError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/field_mask_error_pb.rb b/lib/google/ads/google_ads/v16/errors/field_mask_error_pb.rb new file mode 100644 index 000000000..d407ca518 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/field_mask_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/field_mask_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/ads/googleads/v16/errors/field_mask_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xa7\x01\n\x12\x46ieldMaskErrorEnum\"\x90\x01\n\x0e\x46ieldMaskError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x16\n\x12\x46IELD_MASK_MISSING\x10\x05\x12\x1a\n\x16\x46IELD_MASK_NOT_ALLOWED\x10\x04\x12\x13\n\x0f\x46IELD_NOT_FOUND\x10\x02\x12\x17\n\x13\x46IELD_HAS_SUBFIELDS\x10\x03\x42\xf3\x01\n#com.google.ads.googleads.v16.errorsB\x13\x46ieldMaskErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FieldMaskErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FieldMaskErrorEnum").msgclass + FieldMaskErrorEnum::FieldMaskError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FieldMaskErrorEnum.FieldMaskError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/function_error_pb.rb b/lib/google/ads/google_ads/v16/errors/function_error_pb.rb new file mode 100644 index 000000000..8afd108ab --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/function_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/function_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n4google/ads/googleads/v16/errors/function_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xc1\x04\n\x11\x46unctionErrorEnum\"\xab\x04\n\rFunctionError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1b\n\x17INVALID_FUNCTION_FORMAT\x10\x02\x12\x16\n\x12\x44\x41TA_TYPE_MISMATCH\x10\x03\x12 \n\x1cINVALID_CONJUNCTION_OPERANDS\x10\x04\x12\x1e\n\x1aINVALID_NUMBER_OF_OPERANDS\x10\x05\x12\x18\n\x14INVALID_OPERAND_TYPE\x10\x06\x12\x14\n\x10INVALID_OPERATOR\x10\x07\x12 \n\x1cINVALID_REQUEST_CONTEXT_TYPE\x10\x08\x12)\n%INVALID_FUNCTION_FOR_CALL_PLACEHOLDER\x10\t\x12$\n INVALID_FUNCTION_FOR_PLACEHOLDER\x10\n\x12\x13\n\x0fINVALID_OPERAND\x10\x0b\x12\"\n\x1eMISSING_CONSTANT_OPERAND_VALUE\x10\x0c\x12\"\n\x1eINVALID_CONSTANT_OPERAND_VALUE\x10\r\x12\x13\n\x0fINVALID_NESTING\x10\x0e\x12#\n\x1fMULTIPLE_FEED_IDS_NOT_SUPPORTED\x10\x0f\x12/\n+INVALID_FUNCTION_FOR_FEED_WITH_FIXED_SCHEMA\x10\x10\x12\x1a\n\x16INVALID_ATTRIBUTE_NAME\x10\x11\x42\xf2\x01\n#com.google.ads.googleads.v16.errorsB\x12\x46unctionErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + FunctionErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FunctionErrorEnum").msgclass + FunctionErrorEnum::FunctionError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.FunctionErrorEnum.FunctionError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/function_parsing_error_pb.rb b/lib/google/ads/google_ads/v16/errors/function_parsing_error_pb.rb new file mode 100644 index 000000000..189b43db5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/function_parsing_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/function_parsing_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n\x12$\n BAD_RESOURCE_TYPE_IN_FROM_CLAUSE\x10-\x12\x0e\n\nBAD_SYMBOL\x10\x02\x12\r\n\tBAD_VALUE\x10\x04\x12\x17\n\x13\x44\x41TE_RANGE_TOO_WIDE\x10$\x12\x19\n\x15\x44\x41TE_RANGE_TOO_NARROW\x10<\x12\x10\n\x0c\x45XPECTED_AND\x10\x1e\x12\x0f\n\x0b\x45XPECTED_BY\x10\x0e\x12-\n)EXPECTED_DIMENSION_FIELD_IN_SELECT_CLAUSE\x10%\x12\"\n\x1e\x45XPECTED_FILTERS_ON_DATE_RANGE\x10\x37\x12\x11\n\rEXPECTED_FROM\x10,\x12\x11\n\rEXPECTED_LIST\x10)\x12.\n*EXPECTED_REFERENCED_FIELD_IN_SELECT_CLAUSE\x10\x10\x12\x13\n\x0f\x45XPECTED_SELECT\x10\r\x12\x19\n\x15\x45XPECTED_SINGLE_VALUE\x10*\x12(\n$EXPECTED_VALUE_WITH_BETWEEN_OPERATOR\x10\x1d\x12\x17\n\x13INVALID_DATE_FORMAT\x10&\x12\x1e\n\x1aMISALIGNED_DATE_FOR_FILTER\x10@\x12\x18\n\x14INVALID_STRING_VALUE\x10\x39\x12\'\n#INVALID_VALUE_WITH_BETWEEN_OPERATOR\x10\x1a\x12&\n\"INVALID_VALUE_WITH_DURING_OPERATOR\x10\x16\x12$\n INVALID_VALUE_WITH_LIKE_OPERATOR\x10\x38\x12\x1b\n\x17OPERATOR_FIELD_MISMATCH\x10#\x12&\n\"PROHIBITED_EMPTY_LIST_IN_CONDITION\x10\x1c\x12\x1c\n\x18PROHIBITED_ENUM_CONSTANT\x10\x36\x12\x31\n-PROHIBITED_FIELD_COMBINATION_IN_SELECT_CLAUSE\x10\x1f\x12\'\n#PROHIBITED_FIELD_IN_ORDER_BY_CLAUSE\x10(\x12%\n!PROHIBITED_FIELD_IN_SELECT_CLAUSE\x10\x17\x12$\n PROHIBITED_FIELD_IN_WHERE_CLAUSE\x10\x18\x12+\n\'PROHIBITED_RESOURCE_TYPE_IN_FROM_CLAUSE\x10+\x12-\n)PROHIBITED_RESOURCE_TYPE_IN_SELECT_CLAUSE\x10\x30\x12,\n(PROHIBITED_RESOURCE_TYPE_IN_WHERE_CLAUSE\x10:\x12/\n+PROHIBITED_METRIC_IN_SELECT_OR_WHERE_CLAUSE\x10\x31\x12\x30\n,PROHIBITED_SEGMENT_IN_SELECT_OR_WHERE_CLAUSE\x10\x33\x12<\n8PROHIBITED_SEGMENT_WITH_METRIC_IN_SELECT_OR_WHERE_CLAUSE\x10\x35\x12\x17\n\x13LIMIT_VALUE_TOO_LOW\x10\x19\x12 \n\x1cPROHIBITED_NEWLINE_IN_STRING\x10\x08\x12(\n$PROHIBITED_VALUE_COMBINATION_IN_LIST\x10\n\x12\x36\n2PROHIBITED_VALUE_COMBINATION_WITH_BETWEEN_OPERATOR\x10\x15\x12\x19\n\x15STRING_NOT_TERMINATED\x10\x06\x12\x15\n\x11TOO_MANY_SEGMENTS\x10\"\x12\x1b\n\x17UNEXPECTED_END_OF_QUERY\x10\t\x12\x1a\n\x16UNEXPECTED_FROM_CLAUSE\x10/\x12\x16\n\x12UNRECOGNIZED_FIELD\x10 \x12\x14\n\x10UNEXPECTED_INPUT\x10\x0b\x12!\n\x1dREQUESTED_METRICS_FOR_MANAGER\x10;\x12\x1e\n\x1a\x46ILTER_HAS_TOO_MANY_VALUES\x10?B\xef\x01\n#com.google.ads.googleads.v16.errorsB\x0fQueryErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + QueryErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.QueryErrorEnum").msgclass + QueryErrorEnum::QueryError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.QueryErrorEnum.QueryError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/quota_error_pb.rb b/lib/google/ads/google_ads/v16/errors/quota_error_pb.rb new file mode 100644 index 000000000..562914450 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/quota_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/quota_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/ads/googleads/v16/errors/quota_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x8f\x01\n\x0eQuotaErrorEnum\"}\n\nQuotaError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x16\n\x12RESOURCE_EXHAUSTED\x10\x02\x12\x15\n\x11\x41\x43\x43\x45SS_PROHIBITED\x10\x03\x12\"\n\x1eRESOURCE_TEMPORARILY_EXHAUSTED\x10\x04\x42\xef\x01\n#com.google.ads.googleads.v16.errorsB\x0fQuotaErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + QuotaErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.QuotaErrorEnum").msgclass + QuotaErrorEnum::QuotaError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.QuotaErrorEnum.QuotaError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/range_error_pb.rb b/lib/google/ads/google_ads/v16/errors/range_error_pb.rb new file mode 100644 index 000000000..90a8bc76b --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/range_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/range_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/ads/googleads/v16/errors/range_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"W\n\x0eRangeErrorEnum\"E\n\nRangeError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0b\n\x07TOO_LOW\x10\x02\x12\x0c\n\x08TOO_HIGH\x10\x03\x42\xef\x01\n#com.google.ads.googleads.v16.errorsB\x0fRangeErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + RangeErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RangeErrorEnum").msgclass + RangeErrorEnum::RangeError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RangeErrorEnum.RangeError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/reach_plan_error_pb.rb b/lib/google/ads/google_ads/v16/errors/reach_plan_error_pb.rb new file mode 100644 index 000000000..be821a49f --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/reach_plan_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/reach_plan_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/ads/googleads/v16/errors/reach_plan_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xbd\x01\n\x12ReachPlanErrorEnum\"\xa6\x01\n\x0eReachPlanError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12!\n\x1dNOT_FORECASTABLE_MISSING_RATE\x10\x02\x12)\n%NOT_FORECASTABLE_NOT_ENOUGH_INVENTORY\x10\x03\x12(\n$NOT_FORECASTABLE_ACCOUNT_NOT_ENABLED\x10\x04\x42\xf3\x01\n#com.google.ads.googleads.v16.errorsB\x13ReachPlanErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ReachPlanErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ReachPlanErrorEnum").msgclass + ReachPlanErrorEnum::ReachPlanError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ReachPlanErrorEnum.ReachPlanError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/recommendation_error_pb.rb b/lib/google/ads/google_ads/v16/errors/recommendation_error_pb.rb new file mode 100644 index 000000000..0bf73b097 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/recommendation_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/recommendation_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/ads/googleads/v16/errors/recommendation_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xae\x05\n\x17RecommendationErrorEnum\"\x92\x05\n\x13RecommendationError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x1b\n\x17\x42UDGET_AMOUNT_TOO_SMALL\x10\x02\x12\x1b\n\x17\x42UDGET_AMOUNT_TOO_LARGE\x10\x03\x12\x19\n\x15INVALID_BUDGET_AMOUNT\x10\x04\x12\x10\n\x0cPOLICY_ERROR\x10\x05\x12\x16\n\x12INVALID_BID_AMOUNT\x10\x06\x12\x19\n\x15\x41\x44GROUP_KEYWORD_LIMIT\x10\x07\x12\"\n\x1eRECOMMENDATION_ALREADY_APPLIED\x10\x08\x12\x1e\n\x1aRECOMMENDATION_INVALIDATED\x10\t\x12\x17\n\x13TOO_MANY_OPERATIONS\x10\n\x12\x11\n\rNO_OPERATIONS\x10\x0b\x12!\n\x1d\x44IFFERENT_TYPES_NOT_SUPPORTED\x10\x0c\x12\x1b\n\x17\x44UPLICATE_RESOURCE_NAME\x10\r\x12$\n RECOMMENDATION_ALREADY_DISMISSED\x10\x0e\x12\x19\n\x15INVALID_APPLY_REQUEST\x10\x0f\x12+\n\'RECOMMENDATION_TYPE_APPLY_NOT_SUPPORTED\x10\x11\x12\x16\n\x12INVALID_MULTIPLIER\x10\x12\x12\x33\n/ADVERTISING_CHANNEL_TYPE_GENERATE_NOT_SUPPORTED\x10\x13\x12.\n*RECOMMENDATION_TYPE_GENERATE_NOT_SUPPORTED\x10\x14\x12(\n$RECOMMENDATION_TYPES_CANNOT_BE_EMPTY\x10\x15\x42\xf8\x01\n#com.google.ads.googleads.v16.errorsB\x18RecommendationErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + RecommendationErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RecommendationErrorEnum").msgclass + RecommendationErrorEnum::RecommendationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RecommendationErrorEnum.RecommendationError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/recommendation_subscription_error_pb.rb b/lib/google/ads/google_ads/v16/errors/recommendation_subscription_error_pb.rb new file mode 100644 index 000000000..95e14a683 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/recommendation_subscription_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/recommendation_subscription_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/errors/recommendation_subscription_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"f\n#RecommendationSubscriptionErrorEnum\"?\n\x1fRecommendationSubscriptionError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x42\x84\x02\n#com.google.ads.googleads.v16.errorsB$RecommendationSubscriptionErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + RecommendationSubscriptionErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RecommendationSubscriptionErrorEnum").msgclass + RecommendationSubscriptionErrorEnum::RecommendationSubscriptionError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RecommendationSubscriptionErrorEnum.RecommendationSubscriptionError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/region_code_error_pb.rb b/lib/google/ads/google_ads/v16/errors/region_code_error_pb.rb new file mode 100644 index 000000000..836c4291a --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/region_code_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/region_code_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n7google/ads/googleads/v16/errors/region_code_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"_\n\x13RegionCodeErrorEnum\"H\n\x0fRegionCodeError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x17\n\x13INVALID_REGION_CODE\x10\x02\x42\xf4\x01\n#com.google.ads.googleads.v16.errorsB\x14RegionCodeErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + RegionCodeErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RegionCodeErrorEnum").msgclass + RegionCodeErrorEnum::RegionCodeError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RegionCodeErrorEnum.RegionCodeError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/request_error_pb.rb b/lib/google/ads/google_ads/v16/errors/request_error_pb.rb new file mode 100644 index 000000000..3b01eea59 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/request_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/request_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n3google/ads/googleads/v16/errors/request_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\x8e\x07\n\x10RequestErrorEnum\"\xf9\x06\n\x0cRequestError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x19\n\x15RESOURCE_NAME_MISSING\x10\x03\x12\x1b\n\x17RESOURCE_NAME_MALFORMED\x10\x04\x12\x13\n\x0f\x42\x41\x44_RESOURCE_ID\x10\x11\x12\x17\n\x13INVALID_CUSTOMER_ID\x10\x10\x12\x16\n\x12OPERATION_REQUIRED\x10\x05\x12\x16\n\x12RESOURCE_NOT_FOUND\x10\x06\x12\x16\n\x12INVALID_PAGE_TOKEN\x10\x07\x12\x16\n\x12\x45XPIRED_PAGE_TOKEN\x10\x08\x12\x15\n\x11INVALID_PAGE_SIZE\x10\x16\x12\x1b\n\x17PAGE_SIZE_NOT_SUPPORTED\x10(\x12\x1a\n\x16REQUIRED_FIELD_MISSING\x10\t\x12\x13\n\x0fIMMUTABLE_FIELD\x10\x0b\x12\x1e\n\x1aTOO_MANY_MUTATE_OPERATIONS\x10\r\x12)\n%CANNOT_BE_EXECUTED_BY_MANAGER_ACCOUNT\x10\x0e\x12\x1f\n\x1b\x43\x41NNOT_MODIFY_FOREIGN_FIELD\x10\x0f\x12\x16\n\x12INVALID_ENUM_VALUE\x10\x12\x12%\n!DEVELOPER_TOKEN_PARAMETER_MISSING\x10\x13\x12\'\n#LOGIN_CUSTOMER_ID_PARAMETER_MISSING\x10\x14\x12(\n$VALIDATE_ONLY_REQUEST_HAS_PAGE_TOKEN\x10\x15\x12\x39\n5CANNOT_RETURN_SUMMARY_ROW_FOR_REQUEST_WITHOUT_METRICS\x10\x1d\x12\x38\n4CANNOT_RETURN_SUMMARY_ROW_FOR_VALIDATE_ONLY_REQUESTS\x10\x1e\x12)\n%INCONSISTENT_RETURN_SUMMARY_ROW_VALUE\x10\x1f\x12\x30\n,TOTAL_RESULTS_COUNT_NOT_ORIGINALLY_REQUESTED\x10 \x12\x1a\n\x16RPC_DEADLINE_TOO_SHORT\x10!\x12\x17\n\x13UNSUPPORTED_VERSION\x10&\x12\x1b\n\x17\x43LOUD_PROJECT_NOT_FOUND\x10\'B\xf1\x01\n#com.google.ads.googleads.v16.errorsB\x11RequestErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + RequestErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RequestErrorEnum").msgclass + RequestErrorEnum::RequestError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.RequestErrorEnum.RequestError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/resource_access_denied_error_pb.rb b/lib/google/ads/google_ads/v16/errors/resource_access_denied_error_pb.rb new file mode 100644 index 000000000..82b179849 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/resource_access_denied_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/resource_access_denied_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/errors/resource_access_denied_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"s\n\x1dResourceAccessDeniedErrorEnum\"R\n\x19ResourceAccessDeniedError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x17\n\x13WRITE_ACCESS_DENIED\x10\x03\x42\xfe\x01\n#com.google.ads.googleads.v16.errorsB\x1eResourceAccessDeniedErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ResourceAccessDeniedErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ResourceAccessDeniedErrorEnum").msgclass + ResourceAccessDeniedErrorEnum::ResourceAccessDeniedError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ResourceAccessDeniedErrorEnum.ResourceAccessDeniedError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/resource_count_limit_exceeded_error_pb.rb b/lib/google/ads/google_ads/v16/errors/resource_count_limit_exceeded_error_pb.rb new file mode 100644 index 000000000..fe38bc6ef --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/resource_count_limit_exceeded_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/resource_count_limit_exceeded_error.proto + +require 'google/protobuf' + + +descriptor_data = "\nIgoogle/ads/googleads/v16/errors/resource_count_limit_exceeded_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xbe\x02\n#ResourceCountLimitExceededErrorEnum\"\x96\x02\n\x1fResourceCountLimitExceededError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x11\n\rACCOUNT_LIMIT\x10\x02\x12\x12\n\x0e\x43\x41MPAIGN_LIMIT\x10\x03\x12\x11\n\rADGROUP_LIMIT\x10\x04\x12\x15\n\x11\x41\x44_GROUP_AD_LIMIT\x10\x05\x12\x1c\n\x18\x41\x44_GROUP_CRITERION_LIMIT\x10\x06\x12\x14\n\x10SHARED_SET_LIMIT\x10\x07\x12\x1b\n\x17MATCHING_FUNCTION_LIMIT\x10\x08\x12\x1f\n\x1bRESPONSE_ROW_LIMIT_EXCEEDED\x10\t\x12\x12\n\x0eRESOURCE_LIMIT\x10\nB\x84\x02\n#com.google.ads.googleads.v16.errorsB$ResourceCountLimitExceededErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + ResourceCountLimitExceededErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ResourceCountLimitExceededErrorEnum").msgclass + ResourceCountLimitExceededErrorEnum::ResourceCountLimitExceededError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.ResourceCountLimitExceededErrorEnum.ResourceCountLimitExceededError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/search_term_insight_error_pb.rb b/lib/google/ads/google_ads/v16/errors/search_term_insight_error_pb.rb new file mode 100644 index 000000000..636c4be08 --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/search_term_insight_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/search_term_insight_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n?google/ads/googleads/v16/errors/search_term_insight_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xc1\x02\n\x1aSearchTermInsightErrorEnum\"\xa2\x02\n\x16SearchTermInsightError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\'\n#FILTERING_NOT_ALLOWED_WITH_SEGMENTS\x10\x02\x12#\n\x1fLIMIT_NOT_ALLOWED_WITH_SEGMENTS\x10\x03\x12\"\n\x1eMISSING_FIELD_IN_SELECT_CLAUSE\x10\x04\x12&\n\"REQUIRES_FILTER_BY_SINGLE_RESOURCE\x10\x05\x12%\n!SORTING_NOT_ALLOWED_WITH_SEGMENTS\x10\x06\x12)\n%SUMMARY_ROW_NOT_ALLOWED_WITH_SEGMENTS\x10\x07\x42\xfb\x01\n#com.google.ads.googleads.v16.errorsB\x1bSearchTermInsightErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + SearchTermInsightErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.SearchTermInsightErrorEnum").msgclass + SearchTermInsightErrorEnum::SearchTermInsightError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.SearchTermInsightErrorEnum.SearchTermInsightError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/setting_error_pb.rb b/lib/google/ads/google_ads/v16/errors/setting_error_pb.rb new file mode 100644 index 000000000..975d02ede --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/setting_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/setting_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n3google/ads/googleads/v16/errors/setting_error.proto\x12\x1fgoogle.ads.googleads.v16.errors\"\xb7\x06\n\x10SettingErrorEnum\"\xa2\x06\n\x0cSettingError\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12!\n\x1dSETTING_TYPE_IS_NOT_AVAILABLE\x10\x03\x12\x30\n,SETTING_TYPE_IS_NOT_COMPATIBLE_WITH_CAMPAIGN\x10\x04\x12;\n7TARGETING_SETTING_CONTAINS_INVALID_CRITERION_TYPE_GROUP\x10\x05\x12Q\nMTARGETING_SETTING_DEMOGRAPHIC_CRITERION_TYPE_GROUPS_MUST_BE_SET_TO_TARGET_ALL\x10\x06\x12\\\nXTARGETING_SETTING_CANNOT_CHANGE_TARGET_ALL_TO_FALSE_FOR_DEMOGRAPHIC_CRITERION_TYPE_GROUP\x10\x07\x12\x43\n?DYNAMIC_SEARCH_ADS_SETTING_AT_LEAST_ONE_FEED_ID_MUST_BE_PRESENT\x10\x08\x12;\n7DYNAMIC_SEARCH_ADS_SETTING_CONTAINS_INVALID_DOMAIN_NAME\x10\t\x12\x36\n2DYNAMIC_SEARCH_ADS_SETTING_CONTAINS_SUBDOMAIN_NAME\x10\n\x12=\n9DYNAMIC_SEARCH_ADS_SETTING_CONTAINS_INVALID_LANGUAGE_CODE\x10\x0b\x12>\n:TARGET_ALL_IS_NOT_ALLOWED_FOR_PLACEMENT_IN_SEARCH_CAMPAIGN\x10\x0c\x12.\n*SETTING_VALUE_NOT_COMPATIBLE_WITH_CAMPAIGN\x10\x14\x12H\nDBID_ONLY_IS_NOT_ALLOWED_TO_BE_MODIFIED_WITH_CUSTOMER_MATCH_TARGETING\x10\x15\x42\xf1\x01\n#com.google.ads.googleads.v16.errorsB\x11SettingErrorProtoP\x01ZEgoogle.golang.org/genproto/googleapis/ads/googleads/v16/errors;errors\xa2\x02\x03GAA\xaa\x02\x1fGoogle.Ads.GoogleAds.V16.Errors\xca\x02\x1fGoogle\\Ads\\GoogleAds\\V16\\Errors\xea\x02#Google::Ads::GoogleAds::V16::Errorsb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Errors + SettingErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.SettingErrorEnum").msgclass + SettingErrorEnum::SettingError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.errors.SettingErrorEnum.SettingError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/errors/shared_criterion_error_pb.rb b/lib/google/ads/google_ads/v16/errors/shared_criterion_error_pb.rb new file mode 100644 index 000000000..b09dac4bb --- /dev/null +++ b/lib/google/ads/google_ads/v16/errors/shared_criterion_error_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/errors/shared_criterion_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n\xe0\x41\x03\xfa\x41\x38\n6googleads.googleapis.com/AdGroupAdAssetCombinationView\x12G\n\rserved_assets\x18\x02 \x03(\x0b\x32+.google.ads.googleads.v16.common.AssetUsageB\x03\xe0\x41\x03\x12\x19\n\x07\x65nabled\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01:\xc2\x01\xea\x41\xbe\x01\n6googleads.googleapis.com/AdGroupAdAssetCombinationView\x12\x83\x01\x63ustomers/{customer_id}/adGroupAdAssetCombinationViews/{ad_group_id}~{ad_id}~{asset_combination_id_low}~{asset_combination_id_high}B\n\n\x08_enabledB\x94\x02\n&com.google.ads.googleads.v16.resourcesB\"AdGroupAdAssetCombinationViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AssetUsage", "google/ads/googleads/v16/common/asset_usage.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupAdAssetCombinationView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupAdAssetCombinationView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_ad_asset_view_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_ad_asset_view_pb.rb new file mode 100644 index 000000000..d21a28020 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_ad_asset_view_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group_ad_asset_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/policy_pb' +require 'google/ads/google_ads/v16/enums/asset_field_type_pb' +require 'google/ads/google_ads/v16/enums/asset_performance_label_pb' +require 'google/ads/google_ads/v16/enums/asset_source_pb' +require 'google/ads/google_ads/v16/enums/policy_approval_status_pb' +require 'google/ads/google_ads/v16/enums/policy_review_status_pb' +require 'google/ads/google_ads/v16/enums/served_asset_field_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/resources/ad_group_ad_asset_view.proto\x12\"google.ads.googleads.v16.resources\x1a,google/ads/googleads/v16/common/policy.proto\x1a\x35google/ads/googleads/v16/enums/asset_field_type.proto\x1agoogle/ads/googleads/v16/enums/asset_link_primary_status.proto\x1a\x45google/ads/googleads/v16/enums/asset_link_primary_status_reason.proto\x1a\x36google/ads/googleads/v16/enums/asset_link_status.proto\x1a\x31google/ads/googleads/v16/enums/asset_source.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa6\x07\n\x0c\x41\x64GroupAsset\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xe0\x41\x05\xfa\x41\'\n%googleads.googleapis.com/AdGroupAsset\x12=\n\x08\x61\x64_group\x18\x02 \x01(\tB+\xe0\x41\x02\xe0\x41\x05\xfa\x41\"\n googleads.googleapis.com/AdGroup\x12\x38\n\x05\x61sset\x18\x03 \x01(\tB)\xe0\x41\x02\xe0\x41\x05\xfa\x41 \n\x1egoogleads.googleapis.com/Asset\x12]\n\nfield_type\x18\x04 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetFieldTypeEnum.AssetFieldTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12P\n\x06source\x18\x06 \x01(\x0e\x32;.google.ads.googleads.v16.enums.AssetSourceEnum.AssetSourceB\x03\xe0\x41\x03\x12S\n\x06status\x18\x05 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.AssetLinkStatusEnum.AssetLinkStatus\x12n\n\x0eprimary_status\x18\x07 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.AssetLinkPrimaryStatusEnum.AssetLinkPrimaryStatusB\x03\xe0\x41\x03\x12\x63\n\x16primary_status_details\x18\x08 \x03(\x0b\x32>.google.ads.googleads.v16.common.AssetLinkPrimaryStatusDetailsB\x03\xe0\x41\x03\x12\x82\x01\n\x16primary_status_reasons\x18\t \x03(\x0e\x32].google.ads.googleads.v16.enums.AssetLinkPrimaryStatusReasonEnum.AssetLinkPrimaryStatusReasonB\x03\xe0\x41\x03:w\xea\x41t\n%googleads.googleapis.com/AdGroupAsset\x12Kcustomers/{customer_id}/adGroupAssets/{ad_group_id}~{asset_id}~{field_type}B\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11\x41\x64GroupAssetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AssetLinkPrimaryStatusDetails", "google/ads/googleads/v16/common/asset_policy.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupAsset").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_asset_set_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_asset_set_pb.rb new file mode 100644 index 000000000..6aec7ae10 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_asset_set_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group_asset_set.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/asset_set_link_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/resources/ad_group_asset_set.proto\x12\"google.ads.googleads.v16.resources\x1a:google/ads/googleads/v16/enums/asset_set_link_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xaa\x03\n\x0f\x41\x64GroupAssetSet\x12G\n\rresource_name\x18\x01 \x01(\tB0\xe0\x41\x05\xfa\x41*\n(googleads.googleapis.com/AdGroupAssetSet\x12:\n\x08\x61\x64_group\x18\x02 \x01(\tB(\xe0\x41\x05\xfa\x41\"\n googleads.googleapis.com/AdGroup\x12<\n\tasset_set\x18\x03 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/AssetSet\x12^\n\x06status\x18\x04 \x01(\x0e\x32I.google.ads.googleads.v16.enums.AssetSetLinkStatusEnum.AssetSetLinkStatusB\x03\xe0\x41\x03:t\xea\x41q\n(googleads.googleapis.com/AdGroupAssetSet\x12\x45\x63ustomers/{customer_id}/adGroupAssetSets/{ad_group_id}~{asset_set_id}B\x86\x02\n&com.google.ads.googleads.v16.resourcesB\x14\x41\x64GroupAssetSetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupAssetSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupAssetSet").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_audience_view_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_audience_view_pb.rb new file mode 100644 index 000000000..aa0e0da50 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_audience_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group_audience_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/resources/ad_group_audience_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe0\x01\n\x13\x41\x64GroupAudienceView\x12K\n\rresource_name\x18\x01 \x01(\tB4\xe0\x41\x03\xfa\x41.\n,googleads.googleapis.com/AdGroupAudienceView:|\xea\x41y\n,googleads.googleapis.com/AdGroupAudienceView\x12Icustomers/{customer_id}/adGroupAudienceViews/{ad_group_id}~{criterion_id}B\x8a\x02\n&com.google.ads.googleads.v16.resourcesB\x18\x41\x64GroupAudienceViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupAudienceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupAudienceView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_bid_modifier_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_bid_modifier_pb.rb new file mode 100644 index 000000000..37ee7aa13 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_bid_modifier_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group_bid_modifier.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/enums/bid_modifier_source_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/resources/ad_group_bid_modifier.proto\x12\"google.ads.googleads.v16.resources\x1a.google/ads/googleads/v16/common/criteria.proto\x1a\x38google/ads/googleads/v16/enums/bid_modifier_source.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x8b\t\n\x12\x41\x64GroupBidModifier\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x05\xfa\x41-\n+googleads.googleapis.com/AdGroupBidModifier\x12?\n\x08\x61\x64_group\x18\r \x01(\tB(\xe0\x41\x05\xfa\x41\"\n googleads.googleapis.com/AdGroupH\x01\x88\x01\x01\x12\x1e\n\x0c\x63riterion_id\x18\x0e \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x19\n\x0c\x62id_modifier\x18\x0f \x01(\x01H\x03\x88\x01\x01\x12\x44\n\rbase_ad_group\x18\x10 \x01(\tB(\xe0\x41\x03\xfa\x41\"\n googleads.googleapis.com/AdGroupH\x04\x88\x01\x01\x12i\n\x13\x62id_modifier_source\x18\n \x01(\x0e\x32G.google.ads.googleads.v16.enums.BidModifierSourceEnum.BidModifierSourceB\x03\xe0\x41\x03\x12\x65\n\x19hotel_date_selection_type\x18\x05 \x01(\x0b\x32;.google.ads.googleads.v16.common.HotelDateSelectionTypeInfoB\x03\xe0\x41\x05H\x00\x12k\n\x1chotel_advance_booking_window\x18\x06 \x01(\x0b\x32>.google.ads.googleads.v16.common.HotelAdvanceBookingWindowInfoB\x03\xe0\x41\x05H\x00\x12[\n\x14hotel_length_of_stay\x18\x07 \x01(\x0b\x32\x36.google.ads.googleads.v16.common.HotelLengthOfStayInfoB\x03\xe0\x41\x05H\x00\x12W\n\x12hotel_check_in_day\x18\x08 \x01(\x0b\x32\x34.google.ads.googleads.v16.common.HotelCheckInDayInfoB\x03\xe0\x41\x05H\x00\x12\x42\n\x06\x64\x65vice\x18\x0b \x01(\x0b\x32+.google.ads.googleads.v16.common.DeviceInfoB\x03\xe0\x41\x05H\x00\x12\x64\n\x19hotel_check_in_date_range\x18\x11 \x01(\x0b\x32:.google.ads.googleads.v16.common.HotelCheckInDateRangeInfoB\x03\xe0\x41\x05H\x00:z\xea\x41w\n+googleads.googleapis.com/AdGroupBidModifier\x12Hcustomers/{customer_id}/adGroupBidModifiers/{ad_group_id}~{criterion_id}B\x0b\n\tcriterionB\x0b\n\t_ad_groupB\x0f\n\r_criterion_idB\x0f\n\r_bid_modifierB\x10\n\x0e_base_ad_groupB\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17\x41\x64GroupBidModifierProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.HotelDateSelectionTypeInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupBidModifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupBidModifier").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_criterion_customizer_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_criterion_customizer_pb.rb new file mode 100644 index 000000000..f2d8df94d --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_criterion_customizer_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group_criterion_customizer.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/customizer_value_pb' +require 'google/ads/google_ads/v16/enums/customizer_value_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/resources/ad_group_criterion_customizer.proto\x12\"google.ads.googleads.v16.resources\x1a\x36google/ads/googleads/v16/common/customizer_value.proto\x1agoogle/ads/googleads/v16/enums/ad_group_criterion_status.proto\x1a\x33google/ads/googleads/v16/enums/bidding_source.proto\x1a\x44google/ads/googleads/v16/enums/criterion_system_serving_status.proto\x1a\x33google/ads/googleads/v16/enums/criterion_type.proto\x1a\x39google/ads/googleads/v16/enums/quality_score_bucket.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xbf\'\n\x10\x41\x64GroupCriterion\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x05\xfa\x41+\n)googleads.googleapis.com/AdGroupCriterion\x12\x1e\n\x0c\x63riterion_id\x18\x38 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x19\n\x0c\x64isplay_name\x18M \x01(\tB\x03\xe0\x41\x03\x12\x61\n\x06status\x18\x03 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.AdGroupCriterionStatusEnum.AdGroupCriterionStatus\x12[\n\x0cquality_info\x18\x04 \x01(\x0b\x32@.google.ads.googleads.v16.resources.AdGroupCriterion.QualityInfoB\x03\xe0\x41\x03\x12?\n\x08\x61\x64_group\x18\x39 \x01(\tB(\xe0\x41\x05\xfa\x41\"\n googleads.googleapis.com/AdGroupH\x02\x88\x01\x01\x12R\n\x04type\x18\x19 \x01(\x0e\x32?.google.ads.googleads.v16.enums.CriterionTypeEnum.CriterionTypeB\x03\xe0\x41\x03\x12\x1a\n\x08negative\x18: \x01(\x08\x42\x03\xe0\x41\x05H\x03\x88\x01\x01\x12\x81\x01\n\x15system_serving_status\x18\x34 \x01(\x0e\x32].google.ads.googleads.v16.enums.CriterionSystemServingStatusEnum.CriterionSystemServingStatusB\x03\xe0\x41\x03\x12\x7f\n\x0f\x61pproval_status\x18\x35 \x01(\x0e\x32\x61.google.ads.googleads.v16.enums.AdGroupCriterionApprovalStatusEnum.AdGroupCriterionApprovalStatusB\x03\xe0\x41\x03\x12 \n\x13\x64isapproval_reasons\x18; \x03(\tB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18< \x03(\tB6\xe0\x41\x03\xfa\x41\x30\n.googleads.googleapis.com/AdGroupCriterionLabel\x12\x19\n\x0c\x62id_modifier\x18= \x01(\x01H\x04\x88\x01\x01\x12\x1b\n\x0e\x63pc_bid_micros\x18> \x01(\x03H\x05\x88\x01\x01\x12\x1b\n\x0e\x63pm_bid_micros\x18? \x01(\x03H\x06\x88\x01\x01\x12\x1b\n\x0e\x63pv_bid_micros\x18@ \x01(\x03H\x07\x88\x01\x01\x12#\n\x16percent_cpc_bid_micros\x18\x41 \x01(\x03H\x08\x88\x01\x01\x12*\n\x18\x65\x66\x66\x65\x63tive_cpc_bid_micros\x18\x42 \x01(\x03\x42\x03\xe0\x41\x03H\t\x88\x01\x01\x12*\n\x18\x65\x66\x66\x65\x63tive_cpm_bid_micros\x18\x43 \x01(\x03\x42\x03\xe0\x41\x03H\n\x88\x01\x01\x12*\n\x18\x65\x66\x66\x65\x63tive_cpv_bid_micros\x18\x44 \x01(\x03\x42\x03\xe0\x41\x03H\x0b\x88\x01\x01\x12\x32\n effective_percent_cpc_bid_micros\x18\x45 \x01(\x03\x42\x03\xe0\x41\x03H\x0c\x88\x01\x01\x12\x66\n\x18\x65\x66\x66\x65\x63tive_cpc_bid_source\x18\x15 \x01(\x0e\x32?.google.ads.googleads.v16.enums.BiddingSourceEnum.BiddingSourceB\x03\xe0\x41\x03\x12\x66\n\x18\x65\x66\x66\x65\x63tive_cpm_bid_source\x18\x16 \x01(\x0e\x32?.google.ads.googleads.v16.enums.BiddingSourceEnum.BiddingSourceB\x03\xe0\x41\x03\x12\x66\n\x18\x65\x66\x66\x65\x63tive_cpv_bid_source\x18\x17 \x01(\x0e\x32?.google.ads.googleads.v16.enums.BiddingSourceEnum.BiddingSourceB\x03\xe0\x41\x03\x12n\n effective_percent_cpc_bid_source\x18# \x01(\x0e\x32?.google.ads.googleads.v16.enums.BiddingSourceEnum.BiddingSourceB\x03\xe0\x41\x03\x12g\n\x12position_estimates\x18\n \x01(\x0b\x32\x46.google.ads.googleads.v16.resources.AdGroupCriterion.PositionEstimatesB\x03\xe0\x41\x03\x12\x12\n\nfinal_urls\x18\x46 \x03(\t\x12\x19\n\x11\x66inal_mobile_urls\x18G \x03(\t\x12\x1d\n\x10\x66inal_url_suffix\x18H \x01(\tH\r\x88\x01\x01\x12\"\n\x15tracking_url_template\x18I \x01(\tH\x0e\x88\x01\x01\x12O\n\x15url_custom_parameters\x18\x0e \x03(\x0b\x32\x30.google.ads.googleads.v16.common.CustomParameter\x12\x44\n\x07keyword\x18\x1b \x01(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x05H\x00\x12H\n\tplacement\x18\x1c \x01(\x0b\x32..google.ads.googleads.v16.common.PlacementInfoB\x03\xe0\x41\x05H\x00\x12Z\n\x13mobile_app_category\x18\x1d \x01(\x0b\x32\x36.google.ads.googleads.v16.common.MobileAppCategoryInfoB\x03\xe0\x41\x05H\x00\x12Y\n\x12mobile_application\x18\x1e \x01(\x0b\x32\x36.google.ads.googleads.v16.common.MobileApplicationInfoB\x03\xe0\x41\x05H\x00\x12O\n\rlisting_group\x18 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.ListingGroupInfoB\x03\xe0\x41\x05H\x00\x12G\n\tage_range\x18$ \x01(\x0b\x32-.google.ads.googleads.v16.common.AgeRangeInfoB\x03\xe0\x41\x05H\x00\x12\x42\n\x06gender\x18% \x01(\x0b\x32+.google.ads.googleads.v16.common.GenderInfoB\x03\xe0\x41\x05H\x00\x12M\n\x0cincome_range\x18& \x01(\x0b\x32\x30.google.ads.googleads.v16.common.IncomeRangeInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0fparental_status\x18\' \x01(\x0b\x32\x33.google.ads.googleads.v16.common.ParentalStatusInfoB\x03\xe0\x41\x05H\x00\x12G\n\tuser_list\x18* \x01(\x0b\x32-.google.ads.googleads.v16.common.UserListInfoB\x03\xe0\x41\x05H\x00\x12O\n\ryoutube_video\x18( \x01(\x0b\x32\x31.google.ads.googleads.v16.common.YouTubeVideoInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0fyoutube_channel\x18) \x01(\x0b\x32\x33.google.ads.googleads.v16.common.YouTubeChannelInfoB\x03\xe0\x41\x05H\x00\x12@\n\x05topic\x18+ \x01(\x0b\x32*.google.ads.googleads.v16.common.TopicInfoB\x03\xe0\x41\x05H\x00\x12O\n\ruser_interest\x18- \x01(\x0b\x32\x31.google.ads.googleads.v16.common.UserInterestInfoB\x03\xe0\x41\x05H\x00\x12\x44\n\x07webpage\x18. \x01(\x0b\x32,.google.ads.googleads.v16.common.WebpageInfoB\x03\xe0\x41\x05H\x00\x12V\n\x11\x61pp_payment_model\x18/ \x01(\x0b\x32\x34.google.ads.googleads.v16.common.AppPaymentModelInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0f\x63ustom_affinity\x18\x30 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.CustomAffinityInfoB\x03\xe0\x41\x05H\x00\x12O\n\rcustom_intent\x18\x31 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.CustomIntentInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0f\x63ustom_audience\x18J \x01(\x0b\x32\x33.google.ads.googleads.v16.common.CustomAudienceInfoB\x03\xe0\x41\x05H\x00\x12W\n\x11\x63ombined_audience\x18K \x01(\x0b\x32\x35.google.ads.googleads.v16.common.CombinedAudienceInfoB\x03\xe0\x41\x05H\x00\x12\x46\n\x08\x61udience\x18O \x01(\x0b\x32-.google.ads.googleads.v16.common.AudienceInfoB\x03\xe0\x41\x05H\x00\x12\x46\n\x08location\x18R \x01(\x0b\x32-.google.ads.googleads.v16.common.LocationInfoB\x03\xe0\x41\x05H\x00\x12\x46\n\x08language\x18S \x01(\x0b\x32-.google.ads.googleads.v16.common.LanguageInfoB\x03\xe0\x41\x05H\x00\x1a\x90\x03\n\x0bQualityInfo\x12\x1f\n\rquality_score\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12n\n\x16\x63reative_quality_score\x18\x02 \x01(\x0e\x32I.google.ads.googleads.v16.enums.QualityScoreBucketEnum.QualityScoreBucketB\x03\xe0\x41\x03\x12p\n\x18post_click_quality_score\x18\x03 \x01(\x0e\x32I.google.ads.googleads.v16.enums.QualityScoreBucketEnum.QualityScoreBucketB\x03\xe0\x41\x03\x12l\n\x14search_predicted_ctr\x18\x04 \x01(\x0e\x32I.google.ads.googleads.v16.enums.QualityScoreBucketEnum.QualityScoreBucketB\x03\xe0\x41\x03\x42\x10\n\x0e_quality_score\x1a\xbc\x03\n\x11PositionEstimates\x12\'\n\x15\x66irst_page_cpc_micros\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12+\n\x19\x66irst_position_cpc_micros\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12(\n\x16top_of_page_cpc_micros\x18\x08 \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12<\n*estimated_add_clicks_at_first_position_cpc\x18\t \x01(\x03\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12:\n(estimated_add_cost_at_first_position_cpc\x18\n \x01(\x03\x42\x03\xe0\x41\x03H\x04\x88\x01\x01\x42\x18\n\x16_first_page_cpc_microsB\x1c\n\x1a_first_position_cpc_microsB\x19\n\x17_top_of_page_cpc_microsB-\n+_estimated_add_clicks_at_first_position_cpcB+\n)_estimated_add_cost_at_first_position_cpc:t\xea\x41q\n)googleads.googleapis.com/AdGroupCriterion\x12\x44\x63ustomers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}B\x0b\n\tcriterionB\x0f\n\r_criterion_idB\x0b\n\t_ad_groupB\x0b\n\t_negativeB\x0f\n\r_bid_modifierB\x11\n\x0f_cpc_bid_microsB\x11\n\x0f_cpm_bid_microsB\x11\n\x0f_cpv_bid_microsB\x19\n\x17_percent_cpc_bid_microsB\x1b\n\x19_effective_cpc_bid_microsB\x1b\n\x19_effective_cpm_bid_microsB\x1b\n\x19_effective_cpv_bid_microsB#\n!_effective_percent_cpc_bid_microsB\x13\n\x11_final_url_suffixB\x18\n\x16_tracking_url_templateB\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15\x41\x64GroupCriterionProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CustomParameter", "google/ads/googleads/v16/common/custom_parameter.proto"], + ["google.ads.googleads.v16.common.KeywordInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupCriterion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupCriterion").msgclass + AdGroupCriterion::QualityInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupCriterion.QualityInfo").msgclass + AdGroupCriterion::PositionEstimates = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupCriterion.PositionEstimates").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_criterion_simulation_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_criterion_simulation_pb.rb new file mode 100644 index 000000000..9b75318ce --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_criterion_simulation_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group_criterion_simulation.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/simulation_pb' +require 'google/ads/google_ads/v16/enums/simulation_modification_method_pb' +require 'google/ads/google_ads/v16/enums/simulation_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/resources/ad_group_criterion_simulation.proto\x12\"google.ads.googleads.v16.resources\x1a\x30google/ads/googleads/v16/common/simulation.proto\x1a\x43google/ads/googleads/v16/enums/simulation_modification_method.proto\x1a\x34google/ads/googleads/v16/enums/simulation_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9c\x07\n\x1a\x41\x64GroupCriterionSimulation\x12R\n\rresource_name\x18\x01 \x01(\tB;\xe0\x41\x03\xfa\x41\x35\n3googleads.googleapis.com/AdGroupCriterionSimulation\x12\x1d\n\x0b\x61\x64_group_id\x18\t \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1e\n\x0c\x63riterion_id\x18\n \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12T\n\x04type\x18\x04 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.SimulationTypeEnum.SimulationTypeB\x03\xe0\x41\x03\x12\x7f\n\x13modification_method\x18\x05 \x01(\x0e\x32].google.ads.googleads.v16.enums.SimulationModificationMethodEnum.SimulationModificationMethodB\x03\xe0\x41\x03\x12\x1c\n\nstart_date\x18\x0b \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x1a\n\x08\x65nd_date\x18\x0c \x01(\tB\x03\xe0\x41\x03H\x04\x88\x01\x01\x12]\n\x12\x63pc_bid_point_list\x18\x08 \x01(\x0b\x32:.google.ads.googleads.v16.common.CpcBidSimulationPointListB\x03\xe0\x41\x03H\x00\x12l\n\x1apercent_cpc_bid_point_list\x18\r \x01(\x0b\x32\x41.google.ads.googleads.v16.common.PercentCpcBidSimulationPointListB\x03\xe0\x41\x03H\x00:\xc1\x01\xea\x41\xbd\x01\n3googleads.googleapis.com/AdGroupCriterionSimulation\x12\x85\x01\x63ustomers/{customer_id}/adGroupCriterionSimulations/{ad_group_id}~{criterion_id}~{type}~{modification_method}~{start_date}~{end_date}B\x0c\n\npoint_listB\x0e\n\x0c_ad_group_idB\x0f\n\r_criterion_idB\r\n\x0b_start_dateB\x0b\n\t_end_dateB\x91\x02\n&com.google.ads.googleads.v16.resourcesB\x1f\x41\x64GroupCriterionSimulationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CpcBidSimulationPointList", "google/ads/googleads/v16/common/simulation.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupCriterionSimulation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupCriterionSimulation").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_customizer_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_customizer_pb.rb new file mode 100644 index 000000000..e78250c6e --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_customizer_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group_customizer.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/customizer_value_pb' +require 'google/ads/google_ads/v16/enums/customizer_value_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\ncustomers/{customer_id}/adGroupLabels/{ad_group_id}~{label_id}B\x0b\n\t_ad_groupB\x08\n\x06_labelB\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11\x41\x64GroupLabelProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupLabel").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_pb.rb new file mode 100644 index 000000000..c14a69e79 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/custom_parameter_pb' +require 'google/ads/google_ads/v16/common/targeting_setting_pb' +require 'google/ads/google_ads/v16/enums/ad_group_ad_rotation_mode_pb' +require 'google/ads/google_ads/v16/enums/ad_group_primary_status_pb' +require 'google/ads/google_ads/v16/enums/ad_group_primary_status_reason_pb' +require 'google/ads/google_ads/v16/enums/ad_group_status_pb' +require 'google/ads/google_ads/v16/enums/ad_group_type_pb' +require 'google/ads/google_ads/v16/enums/asset_field_type_pb' +require 'google/ads/google_ads/v16/enums/asset_set_type_pb' +require 'google/ads/google_ads/v16/enums/bidding_source_pb' +require 'google/ads/google_ads/v16/enums/targeting_dimension_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n1google/ads/googleads/v16/resources/ad_group.proto\x12\"google.ads.googleads.v16.resources\x1a\x36google/ads/googleads/v16/common/custom_parameter.proto\x1a\x37google/ads/googleads/v16/common/targeting_setting.proto\x1a>google/ads/googleads/v16/enums/ad_group_ad_rotation_mode.proto\x1a \x01(\x0e\x32M.google.ads.googleads.v16.enums.AdGroupPrimaryStatusEnum.AdGroupPrimaryStatusB\x03\xe0\x41\x03\x12~\n\x16primary_status_reasons\x18? \x03(\x0e\x32Y.google.ads.googleads.v16.enums.AdGroupPrimaryStatusReasonEnum.AdGroupPrimaryStatusReasonB\x03\xe0\x41\x03\x1a\x34\n\x0f\x41udienceSetting\x12!\n\x14use_audience_grouped\x18\x01 \x01(\x08\x42\x03\xe0\x41\x05:U\xea\x41R\n googleads.googleapis.com/AdGroup\x12.customers/{customer_id}/adGroups/{ad_group_id}B\x05\n\x03_idB\x07\n\x05_nameB\x10\n\x0e_base_ad_groupB\x18\n\x16_tracking_url_templateB\x0b\n\t_campaignB\x11\n\x0f_cpc_bid_microsB\x1b\n\x19_effective_cpc_bid_microsB\x11\n\x0f_cpm_bid_microsB\x14\n\x12_target_cpa_microsB\x11\n\x0f_cpv_bid_microsB\x14\n\x12_target_cpm_microsB\x0e\n\x0c_target_roasB\x19\n\x17_percent_cpc_bid_microsB\x13\n\x11_final_url_suffixB\x1e\n\x1c_effective_target_cpa_microsB\x18\n\x16_effective_target_roasB\xfe\x01\n&com.google.ads.googleads.v16.resourcesB\x0c\x41\x64GroupProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CustomParameter", "google/ads/googleads/v16/common/custom_parameter.proto"], + ["google.ads.googleads.v16.common.TargetingSetting", "google/ads/googleads/v16/common/targeting_setting.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroup").msgclass + AdGroup::AudienceSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroup.AudienceSetting").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_group_simulation_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_group_simulation_pb.rb new file mode 100644 index 000000000..bdaf48d5a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_group_simulation_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_group_simulation.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/simulation_pb' +require 'google/ads/google_ads/v16/enums/simulation_modification_method_pb' +require 'google/ads/google_ads/v16/enums/simulation_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n.google.ads.googleads.v16.common.TargetRoasSimulationPointListB\x03\xe0\x41\x03H\x00:\x9f\x01\xea\x41\x9b\x01\n*googleads.googleapis.com/AdGroupSimulation\x12mcustomers/{customer_id}/adGroupSimulations/{ad_group_id}~{type}~{modification_method}~{start_date}~{end_date}B\x0c\n\npoint_listB\x0e\n\x0c_ad_group_idB\r\n\x0b_start_dateB\x0b\n\t_end_dateB\x88\x02\n&com.google.ads.googleads.v16.resourcesB\x16\x41\x64GroupSimulationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CpcBidSimulationPointList", "google/ads/googleads/v16/common/simulation.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdGroupSimulation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdGroupSimulation").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_parameter_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_parameter_pb.rb new file mode 100644 index 000000000..bf9d893a6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_parameter_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_parameter.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n5google/ads/googleads/v16/resources/ad_parameter.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa4\x03\n\x0b\x41\x64Parameter\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xe0\x41\x05\xfa\x41&\n$googleads.googleapis.com/AdParameter\x12R\n\x12\x61\x64_group_criterion\x18\x05 \x01(\tB1\xe0\x41\x05\xfa\x41+\n)googleads.googleapis.com/AdGroupCriterionH\x00\x88\x01\x01\x12!\n\x0fparameter_index\x18\x06 \x01(\x03\x42\x03\xe0\x41\x05H\x01\x88\x01\x01\x12\x1b\n\x0einsertion_text\x18\x07 \x01(\tH\x02\x88\x01\x01:~\xea\x41{\n$googleads.googleapis.com/AdParameter\x12Scustomers/{customer_id}/adParameters/{ad_group_id}~{criterion_id}~{parameter_index}B\x15\n\x13_ad_group_criterionB\x12\n\x10_parameter_indexB\x11\n\x0f_insertion_textB\x82\x02\n&com.google.ads.googleads.v16.resourcesB\x10\x41\x64ParameterProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdParameter").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_pb.rb new file mode 100644 index 000000000..f8cd8d0b7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/ad_type_infos_pb' +require 'google/ads/google_ads/v16/common/custom_parameter_pb' +require 'google/ads/google_ads/v16/common/final_app_url_pb' +require 'google/ads/google_ads/v16/common/url_collection_pb' +require 'google/ads/google_ads/v16/enums/ad_type_pb' +require 'google/ads/google_ads/v16/enums/device_pb' +require 'google/ads/google_ads/v16/enums/system_managed_entity_source_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n+google/ads/googleads/v16/resources/ad.proto\x12\"google.ads.googleads.v16.resources\x1a\x33google/ads/googleads/v16/common/ad_type_infos.proto\x1a\x36google/ads/googleads/v16/common/custom_parameter.proto\x1a\x33google/ads/googleads/v16/common/final_app_url.proto\x1a\x34google/ads/googleads/v16/common/url_collection.proto\x1a,google/ads/googleads/v16/enums/ad_type.proto\x1a+google/ads/googleads/v16/enums/device.proto\x1a\x41google/ads/googleads/v16/enums/system_managed_entity_source.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe5\x18\n\x02\x41\x64\x12:\n\rresource_name\x18% \x01(\tB#\xe0\x41\x05\xfa\x41\x1d\n\x1bgoogleads.googleapis.com/Ad\x12\x14\n\x02id\x18( \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x12\n\nfinal_urls\x18) \x03(\t\x12\x44\n\x0e\x66inal_app_urls\x18# \x03(\x0b\x32,.google.ads.googleads.v16.common.FinalAppUrl\x12\x19\n\x11\x66inal_mobile_urls\x18* \x03(\t\x12\"\n\x15tracking_url_template\x18+ \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10\x66inal_url_suffix\x18, \x01(\tH\x03\x88\x01\x01\x12O\n\x15url_custom_parameters\x18\n \x03(\x0b\x32\x30.google.ads.googleads.v16.common.CustomParameter\x12\x18\n\x0b\x64isplay_url\x18- \x01(\tH\x04\x88\x01\x01\x12\x44\n\x04type\x18\x05 \x01(\x0e\x32\x31.google.ads.googleads.v16.enums.AdTypeEnum.AdTypeB\x03\xe0\x41\x03\x12%\n\x13\x61\x64\x64\x65\x64_by_google_ads\x18. \x01(\x08\x42\x03\xe0\x41\x03H\x05\x88\x01\x01\x12L\n\x11\x64\x65vice_preference\x18\x14 \x01(\x0e\x32\x31.google.ads.googleads.v16.enums.DeviceEnum.Device\x12G\n\x0furl_collections\x18\x1a \x03(\x0b\x32..google.ads.googleads.v16.common.UrlCollection\x12\x16\n\x04name\x18/ \x01(\tB\x03\xe0\x41\x05H\x06\x88\x01\x01\x12\x88\x01\n\x1esystem_managed_resource_source\x18\x1b \x01(\x0e\x32[.google.ads.googleads.v16.enums.SystemManagedResourceSourceEnum.SystemManagedResourceSourceB\x03\xe0\x41\x03\x12\x43\n\x07text_ad\x18\x06 \x01(\x0b\x32+.google.ads.googleads.v16.common.TextAdInfoB\x03\xe0\x41\x05H\x00\x12O\n\x10\x65xpanded_text_ad\x18\x07 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.ExpandedTextAdInfoH\x00\x12>\n\x07\x63\x61ll_ad\x18\x31 \x01(\x0b\x32+.google.ads.googleads.v16.common.CallAdInfoH\x00\x12g\n\x1a\x65xpanded_dynamic_search_ad\x18\x0e \x01(\x0b\x32<.google.ads.googleads.v16.common.ExpandedDynamicSearchAdInfoB\x03\xe0\x41\x05H\x00\x12@\n\x08hotel_ad\x18\x0f \x01(\x0b\x32,.google.ads.googleads.v16.common.HotelAdInfoH\x00\x12Q\n\x11shopping_smart_ad\x18\x11 \x01(\x0b\x32\x34.google.ads.googleads.v16.common.ShoppingSmartAdInfoH\x00\x12U\n\x13shopping_product_ad\x18\x12 \x01(\x0b\x32\x36.google.ads.googleads.v16.common.ShoppingProductAdInfoH\x00\x12\x45\n\x08image_ad\x18\x16 \x01(\x0b\x32,.google.ads.googleads.v16.common.ImageAdInfoB\x03\xe0\x41\x05H\x00\x12@\n\x08video_ad\x18\x18 \x01(\x0b\x32,.google.ads.googleads.v16.common.VideoAdInfoH\x00\x12U\n\x13video_responsive_ad\x18\' \x01(\x0b\x32\x36.google.ads.googleads.v16.common.VideoResponsiveAdInfoH\x00\x12W\n\x14responsive_search_ad\x18\x19 \x01(\x0b\x32\x37.google.ads.googleads.v16.common.ResponsiveSearchAdInfoH\x00\x12\x66\n\x1clegacy_responsive_display_ad\x18\x1c \x01(\x0b\x32>.google.ads.googleads.v16.common.LegacyResponsiveDisplayAdInfoH\x00\x12<\n\x06\x61pp_ad\x18\x1d \x01(\x0b\x32*.google.ads.googleads.v16.common.AppAdInfoH\x00\x12]\n\x15legacy_app_install_ad\x18\x1e \x01(\x0b\x32\x37.google.ads.googleads.v16.common.LegacyAppInstallAdInfoB\x03\xe0\x41\x05H\x00\x12Y\n\x15responsive_display_ad\x18\x1f \x01(\x0b\x32\x38.google.ads.googleads.v16.common.ResponsiveDisplayAdInfoH\x00\x12@\n\x08local_ad\x18 \x01(\x0b\x32,.google.ads.googleads.v16.common.LocalAdInfoH\x00\x12Q\n\x11\x64isplay_upload_ad\x18! \x01(\x0b\x32\x34.google.ads.googleads.v16.common.DisplayUploadAdInfoH\x00\x12Q\n\x11\x61pp_engagement_ad\x18\" \x01(\x0b\x32\x34.google.ads.googleads.v16.common.AppEngagementAdInfoH\x00\x12j\n\x1eshopping_comparison_listing_ad\x18$ \x01(\x0b\x32@.google.ads.googleads.v16.common.ShoppingComparisonListingAdInfoH\x00\x12Q\n\x11smart_campaign_ad\x18\x30 \x01(\x0b\x32\x34.google.ads.googleads.v16.common.SmartCampaignAdInfoH\x00\x12\\\n\x17\x61pp_pre_registration_ad\x18\x32 \x01(\x0b\x32\x39.google.ads.googleads.v16.common.AppPreRegistrationAdInfoH\x00\x12^\n\x18\x64iscovery_multi_asset_ad\x18\x33 \x01(\x0b\x32:.google.ads.googleads.v16.common.DiscoveryMultiAssetAdInfoH\x00\x12Y\n\x15\x64iscovery_carousel_ad\x18\x34 \x01(\x0b\x32\x38.google.ads.googleads.v16.common.DiscoveryCarouselAdInfoH\x00\x12h\n\x1d\x64iscovery_video_responsive_ad\x18< \x01(\x0b\x32?.google.ads.googleads.v16.common.DiscoveryVideoResponsiveAdInfoH\x00\x12X\n\x15\x64\x65mand_gen_product_ad\x18= \x01(\x0b\x32\x37.google.ads.googleads.v16.common.DemandGenProductAdInfoH\x00\x12\x42\n\ttravel_ad\x18\x36 \x01(\x0b\x32-.google.ads.googleads.v16.common.TravelAdInfoH\x00:E\xea\x41\x42\n\x1bgoogleads.googleapis.com/Ad\x12#customers/{customer_id}/ads/{ad_id}B\t\n\x07\x61\x64_dataB\x05\n\x03_idB\x18\n\x16_tracking_url_templateB\x13\n\x11_final_url_suffixB\x0e\n\x0c_display_urlB\x16\n\x14_added_by_google_adsB\x07\n\x05_nameB\xf9\x01\n&com.google.ads.googleads.v16.resourcesB\x07\x41\x64ProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.FinalAppUrl", "google/ads/googleads/v16/common/final_app_url.proto"], + ["google.ads.googleads.v16.common.CustomParameter", "google/ads/googleads/v16/common/custom_parameter.proto"], + ["google.ads.googleads.v16.common.UrlCollection", "google/ads/googleads/v16/common/url_collection.proto"], + ["google.ads.googleads.v16.common.TextAdInfo", "google/ads/googleads/v16/common/ad_type_infos.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + Ad = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Ad").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/ad_schedule_view_pb.rb b/lib/google/ads/google_ads/v16/resources/ad_schedule_view_pb.rb new file mode 100644 index 000000000..d977869c3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/ad_schedule_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/ad_schedule_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/resources/ad_schedule_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xcc\x01\n\x0e\x41\x64ScheduleView\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'googleads.googleapis.com/AdScheduleView:r\xea\x41o\n\'googleads.googleapis.com/AdScheduleView\x12\x44\x63ustomers/{customer_id}/adScheduleViews/{campaign_id}~{criterion_id}B\x85\x02\n&com.google.ads.googleads.v16.resourcesB\x13\x41\x64ScheduleViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AdScheduleView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdScheduleView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/age_range_view_pb.rb b/lib/google/ads/google_ads/v16/resources/age_range_view_pb.rb new file mode 100644 index 000000000..ca97c966e --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/age_range_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/age_range_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n7google/ads/googleads/v16/resources/age_range_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc4\x01\n\x0c\x41geRangeView\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%googleads.googleapis.com/AgeRangeView:n\xea\x41k\n%googleads.googleapis.com/AgeRangeView\x12\x42\x63ustomers/{customer_id}/ageRangeViews/{ad_group_id}~{criterion_id}B\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11\x41geRangeViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AgeRangeView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AgeRangeView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_ad_group_pb.rb b/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_ad_group_pb.rb new file mode 100644 index 000000000..70be6ce42 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_ad_group_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/android_privacy_shared_key_google_ad_group.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/android_privacy_interaction_type_pb' +require 'google/ads/google_ads/v16/enums/android_privacy_network_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nSgoogle/ads/googleads/v16/resources/android_privacy_shared_key_google_ad_group.proto\x12\"google.ads.googleads.v16.resources\x1a\x45google/ads/googleads/v16/enums/android_privacy_interaction_type.proto\x1a\x41google/ads/googleads/v16/enums/android_privacy_network_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa6\x06\n$AndroidPrivacySharedKeyGoogleAdGroup\x12\\\n\rresource_name\x18\x01 \x01(\tBE\xe0\x41\x03\xfa\x41?\n=googleads.googleapis.com/AndroidPrivacySharedKeyGoogleAdGroup\x12\x18\n\x0b\x63\x61mpaign_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x8e\x01\n android_privacy_interaction_type\x18\x03 \x01(\x0e\x32_.google.ads.googleads.v16.enums.AndroidPrivacyInteractionTypeEnum.AndroidPrivacyInteractionTypeB\x03\xe0\x41\x03\x12-\n android_privacy_interaction_date\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x82\x01\n\x1c\x61ndroid_privacy_network_type\x18\x05 \x01(\x0e\x32W.google.ads.googleads.v16.enums.AndroidPrivacyNetworkTypeEnum.AndroidPrivacyNetworkTypeB\x03\xe0\x41\x03\x12\x18\n\x0b\x61\x64_group_id\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03\x12 \n\x13shared_ad_group_key\x18\x07 \x01(\tB\x03\xe0\x41\x03:\x84\x02\xea\x41\x80\x02\n=googleads.googleapis.com/AndroidPrivacySharedKeyGoogleAdGroup\x12\xbe\x01\x63ustomers/{customer_id}/androidPrivacySharedKeyGoogleAdGroups/{campaign_id}~{ad_group_id}~{android_privacy_interaction_type}~{android_privacy_network_type}~{android_privacy_interaction_date}B\x9b\x02\n&com.google.ads.googleads.v16.resourcesB)AndroidPrivacySharedKeyGoogleAdGroupProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AndroidPrivacySharedKeyGoogleAdGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleAdGroup").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_campaign_pb.rb b/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_campaign_pb.rb new file mode 100644 index 000000000..a8016abfe --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_campaign_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/android_privacy_shared_key_google_campaign.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/android_privacy_interaction_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nSgoogle/ads/googleads/v16/resources/android_privacy_shared_key_google_campaign.proto\x12\"google.ads.googleads.v16.resources\x1a\x45google/ads/googleads/v16/enums/android_privacy_interaction_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xde\x04\n%AndroidPrivacySharedKeyGoogleCampaign\x12]\n\rresource_name\x18\x01 \x01(\tBF\xe0\x41\x03\xfa\x41@\n>googleads.googleapis.com/AndroidPrivacySharedKeyGoogleCampaign\x12\x18\n\x0b\x63\x61mpaign_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x8e\x01\n android_privacy_interaction_type\x18\x03 \x01(\x0e\x32_.google.ads.googleads.v16.enums.AndroidPrivacyInteractionTypeEnum.AndroidPrivacyInteractionTypeB\x03\xe0\x41\x03\x12-\n android_privacy_interaction_date\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12 \n\x13shared_campaign_key\x18\x05 \x01(\tB\x03\xe0\x41\x03:\xd9\x01\xea\x41\xd5\x01\n>googleads.googleapis.com/AndroidPrivacySharedKeyGoogleCampaign\x12\x92\x01\x63ustomers/{customer_id}/androidPrivacySharedKeyGoogleCampaigns/{campaign_id}~{android_privacy_interaction_type}~{android_privacy_interaction_date}B\x9c\x02\n&com.google.ads.googleads.v16.resourcesB*AndroidPrivacySharedKeyGoogleCampaignProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AndroidPrivacySharedKeyGoogleCampaign = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleCampaign").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_network_type_pb.rb b/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_network_type_pb.rb new file mode 100644 index 000000000..83b6eb916 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/android_privacy_shared_key_google_network_type_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/android_privacy_shared_key_google_network_type.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/android_privacy_interaction_type_pb' +require 'google/ads/google_ads/v16/enums/android_privacy_network_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nWgoogle/ads/googleads/v16/resources/android_privacy_shared_key_google_network_type.proto\x12\"google.ads.googleads.v16.resources\x1a\x45google/ads/googleads/v16/enums/android_privacy_interaction_type.proto\x1a\x41google/ads/googleads/v16/enums/android_privacy_network_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x92\x06\n(AndroidPrivacySharedKeyGoogleNetworkType\x12`\n\rresource_name\x18\x01 \x01(\tBI\xe0\x41\x03\xfa\x41\x43\nAgoogleads.googleapis.com/AndroidPrivacySharedKeyGoogleNetworkType\x12\x18\n\x0b\x63\x61mpaign_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x8e\x01\n android_privacy_interaction_type\x18\x03 \x01(\x0e\x32_.google.ads.googleads.v16.enums.AndroidPrivacyInteractionTypeEnum.AndroidPrivacyInteractionTypeB\x03\xe0\x41\x03\x12-\n android_privacy_interaction_date\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x82\x01\n\x1c\x61ndroid_privacy_network_type\x18\x05 \x01(\x0e\x32W.google.ads.googleads.v16.enums.AndroidPrivacyNetworkTypeEnum.AndroidPrivacyNetworkTypeB\x03\xe0\x41\x03\x12$\n\x17shared_network_type_key\x18\x06 \x01(\tB\x03\xe0\x41\x03:\xfe\x01\xea\x41\xfa\x01\nAgoogleads.googleapis.com/AndroidPrivacySharedKeyGoogleNetworkType\x12\xb4\x01\x63ustomers/{customer_id}/androidPrivacySharedKeyGoogleNetworkTypes/{campaign_id}~{android_privacy_interaction_type}~{android_privacy_network_type}~{android_privacy_interaction_date}B\x9f\x02\n&com.google.ads.googleads.v16.resourcesB-AndroidPrivacySharedKeyGoogleNetworkTypeProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AndroidPrivacySharedKeyGoogleNetworkType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleNetworkType").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_field_type_view_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_field_type_view_pb.rb new file mode 100644 index 000000000..c30671dcd --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_field_type_view_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_field_type_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/asset_field_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/resources/asset_field_type_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x35google/ads/googleads/v16/enums/asset_field_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa8\x02\n\x12\x41ssetFieldTypeView\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x03\xfa\x41-\n+googleads.googleapis.com/AssetFieldTypeView\x12Z\n\nfield_type\x18\x03 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetFieldTypeEnum.AssetFieldTypeB\x03\xe0\x41\x03:j\xea\x41g\n+googleads.googleapis.com/AssetFieldTypeView\x12\x38\x63ustomers/{customer_id}/assetFieldTypeViews/{field_type}B\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17\x41ssetFieldTypeViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetFieldTypeView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetFieldTypeView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_group_asset_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_group_asset_pb.rb new file mode 100644 index 000000000..3ddee9cfb --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_group_asset_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_group_asset.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/asset_policy_pb' +require 'google/ads/google_ads/v16/common/policy_summary_pb' +require 'google/ads/google_ads/v16/enums/asset_field_type_pb' +require 'google/ads/google_ads/v16/enums/asset_link_primary_status_pb' +require 'google/ads/google_ads/v16/enums/asset_link_primary_status_reason_pb' +require 'google/ads/google_ads/v16/enums/asset_link_status_pb' +require 'google/ads/google_ads/v16/enums/asset_performance_label_pb' +require 'google/ads/google_ads/v16/enums/asset_source_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/resources/asset_group_asset.proto\x12\"google.ads.googleads.v16.resources\x1a\x32google/ads/googleads/v16/common/asset_policy.proto\x1a\x34google/ads/googleads/v16/common/policy_summary.proto\x1a\x35google/ads/googleads/v16/enums/asset_field_type.proto\x1a>google/ads/googleads/v16/enums/asset_link_primary_status.proto\x1a\x45google/ads/googleads/v16/enums/asset_link_primary_status_reason.proto\x1a\x36google/ads/googleads/v16/enums/asset_link_status.proto\x1a.google.ads.googleads.v16.common.AssetLinkPrimaryStatusDetailsB\x03\xe0\x41\x03\x12o\n\x11performance_label\x18\x06 \x01(\x0e\x32O.google.ads.googleads.v16.enums.AssetPerformanceLabelEnum.AssetPerformanceLabelB\x03\xe0\x41\x03\x12K\n\x0epolicy_summary\x18\x07 \x01(\x0b\x32..google.ads.googleads.v16.common.PolicySummaryB\x03\xe0\x41\x03\x12P\n\x06source\x18\x0b \x01(\x0e\x32;.google.ads.googleads.v16.enums.AssetSourceEnum.AssetSourceB\x03\xe0\x41\x03:\x80\x01\xea\x41}\n(googleads.googleapis.com/AssetGroupAsset\x12Qcustomers/{customer_id}/assetGroupAssets/{asset_group_id}~{asset_id}~{field_type}B\x86\x02\n&com.google.ads.googleads.v16.resourcesB\x14\x41ssetGroupAssetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AssetLinkPrimaryStatusDetails", "google/ads/googleads/v16/common/asset_policy.proto"], + ["google.ads.googleads.v16.common.PolicySummary", "google/ads/googleads/v16/common/policy_summary.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetGroupAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetGroupAsset").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_group_listing_group_filter_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_group_listing_group_filter_pb.rb new file mode 100644 index 000000000..7988860f2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_group_listing_group_filter_pb.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_group_listing_group_filter.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/listing_group_filter_custom_attribute_index_pb' +require 'google/ads/google_ads/v16/enums/listing_group_filter_listing_source_pb' +require 'google/ads/google_ads/v16/enums/listing_group_filter_product_category_level_pb' +require 'google/ads/google_ads/v16/enums/listing_group_filter_product_channel_pb' +require 'google/ads/google_ads/v16/enums/listing_group_filter_product_condition_pb' +require 'google/ads/google_ads/v16/enums/listing_group_filter_product_type_level_pb' +require 'google/ads/google_ads/v16/enums/listing_group_filter_type_enum_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nIgoogle/ads/googleads/v16/resources/asset_group_listing_group_filter.proto\x12\"google.ads.googleads.v16.resources\x1aPgoogle/ads/googleads/v16/enums/listing_group_filter_custom_attribute_index.proto\x1aHgoogle/ads/googleads/v16/enums/listing_group_filter_listing_source.proto\x1aPgoogle/ads/googleads/v16/enums/listing_group_filter_product_category_level.proto\x1aIgoogle/ads/googleads/v16/enums/listing_group_filter_product_channel.proto\x1aKgoogle/ads/googleads/v16/enums/listing_group_filter_product_condition.proto\x1aLgoogle/ads/googleads/v16/enums/listing_group_filter_product_type_level.proto\x1a\x43google/ads/googleads/v16/enums/listing_group_filter_type_enum.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe1\x06\n\x1c\x41ssetGroupListingGroupFilter\x12T\n\rresource_name\x18\x01 \x01(\tB=\xe0\x41\x05\xfa\x41\x37\n5googleads.googleapis.com/AssetGroupListingGroupFilter\x12@\n\x0b\x61sset_group\x18\x02 \x01(\tB+\xe0\x41\x05\xfa\x41%\n#googleads.googleapis.com/AssetGroup\x12\x0f\n\x02id\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x64\n\x04type\x18\x04 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.ListingGroupFilterTypeEnum.ListingGroupFilterTypeB\x03\xe0\x41\x05\x12\x80\x01\n\x0elisting_source\x18\t \x01(\x0e\x32\x63.google.ads.googleads.v16.enums.ListingGroupFilterListingSourceEnum.ListingGroupFilterListingSourceB\x03\xe0\x41\x05\x12S\n\ncase_value\x18\x06 \x01(\x0b\x32?.google.ads.googleads.v16.resources.ListingGroupFilterDimension\x12\x62\n\x1bparent_listing_group_filter\x18\x07 \x01(\tB=\xe0\x41\x05\xfa\x41\x37\n5googleads.googleapis.com/AssetGroupListingGroupFilter\x12V\n\x04path\x18\x08 \x01(\x0b\x32\x43.google.ads.googleads.v16.resources.ListingGroupFilterDimensionPathB\x03\xe0\x41\x03:\x9d\x01\xea\x41\x99\x01\n5googleads.googleapis.com/AssetGroupListingGroupFilter\x12`customers/{customer_id}/assetGroupListingGroupFilters/{asset_group_id}~{listing_group_filter_id}\"{\n\x1fListingGroupFilterDimensionPath\x12X\n\ndimensions\x18\x01 \x03(\x0b\x32?.google.ads.googleads.v16.resources.ListingGroupFilterDimensionB\x03\xe0\x41\x03\"\xe1\x0f\n\x1bListingGroupFilterDimension\x12k\n\x10product_category\x18\n \x01(\x0b\x32O.google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductCategoryH\x00\x12\x65\n\rproduct_brand\x18\x02 \x01(\x0b\x32L.google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductBrandH\x00\x12i\n\x0fproduct_channel\x18\x03 \x01(\x0b\x32N.google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductChannelH\x00\x12m\n\x11product_condition\x18\x04 \x01(\x0b\x32P.google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductConditionH\x00\x12z\n\x18product_custom_attribute\x18\x05 \x01(\x0b\x32V.google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductCustomAttributeH\x00\x12h\n\x0fproduct_item_id\x18\x06 \x01(\x0b\x32M.google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductItemIdH\x00\x12\x63\n\x0cproduct_type\x18\x07 \x01(\x0b\x32K.google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductTypeH\x00\x12Z\n\x07webpage\x18\t \x01(\x0b\x32G.google.ads.googleads.v16.resources.ListingGroupFilterDimension.WebpageH\x00\x1a\xbe\x01\n\x0fProductCategory\x12\x18\n\x0b\x63\x61tegory_id\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x80\x01\n\x05level\x18\x02 \x01(\x0e\x32q.google.ads.googleads.v16.enums.ListingGroupFilterProductCategoryLevelEnum.ListingGroupFilterProductCategoryLevelB\x0e\n\x0c_category_id\x1a,\n\x0cProductBrand\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\x1a\x88\x01\n\x0eProductChannel\x12v\n\x07\x63hannel\x18\x01 \x01(\x0e\x32\x65.google.ads.googleads.v16.enums.ListingGroupFilterProductChannelEnum.ListingGroupFilterProductChannel\x1a\x90\x01\n\x10ProductCondition\x12|\n\tcondition\x18\x01 \x01(\x0e\x32i.google.ads.googleads.v16.enums.ListingGroupFilterProductConditionEnum.ListingGroupFilterProductCondition\x1a\xb9\x01\n\x16ProductCustomAttribute\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x80\x01\n\x05index\x18\x02 \x01(\x0e\x32q.google.ads.googleads.v16.enums.ListingGroupFilterCustomAttributeIndexEnum.ListingGroupFilterCustomAttributeIndexB\x08\n\x06_value\x1a-\n\rProductItemId\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\x1a\xa5\x01\n\x0bProductType\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x12x\n\x05level\x18\x02 \x01(\x0e\x32i.google.ads.googleads.v16.enums.ListingGroupFilterProductTypeLevelEnum.ListingGroupFilterProductTypeLevelB\x08\n\x06_value\x1ao\n\x07Webpage\x12\x64\n\nconditions\x18\x01 \x03(\x0b\x32P.google.ads.googleads.v16.resources.ListingGroupFilterDimension.WebpageCondition\x1aO\n\x10WebpageCondition\x12\x16\n\x0c\x63ustom_label\x18\x01 \x01(\tH\x00\x12\x16\n\x0curl_contains\x18\x02 \x01(\tH\x00\x42\x0b\n\tconditionB\x0b\n\tdimensionB\x93\x02\n&com.google.ads.googleads.v16.resourcesB!AssetGroupListingGroupFilterProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetGroupListingGroupFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetGroupListingGroupFilter").msgclass + ListingGroupFilterDimensionPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimensionPath").msgclass + ListingGroupFilterDimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension").msgclass + ListingGroupFilterDimension::ProductCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductCategory").msgclass + ListingGroupFilterDimension::ProductBrand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductBrand").msgclass + ListingGroupFilterDimension::ProductChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductChannel").msgclass + ListingGroupFilterDimension::ProductCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductCondition").msgclass + ListingGroupFilterDimension::ProductCustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductCustomAttribute").msgclass + ListingGroupFilterDimension::ProductItemId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductItemId").msgclass + ListingGroupFilterDimension::ProductType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.ProductType").msgclass + ListingGroupFilterDimension::Webpage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.Webpage").msgclass + ListingGroupFilterDimension::WebpageCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ListingGroupFilterDimension.WebpageCondition").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_group_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_group_pb.rb new file mode 100644 index 000000000..7e142566b --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_group_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_group.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/ad_strength_pb' +require 'google/ads/google_ads/v16/enums/asset_group_primary_status_pb' +require 'google/ads/google_ads/v16/enums/asset_group_primary_status_reason_pb' +require 'google/ads/google_ads/v16/enums/asset_group_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n4google/ads/googleads/v16/resources/asset_group.proto\x12\"google.ads.googleads.v16.resources\x1a\x30google/ads/googleads/v16/enums/ad_strength.proto\x1a?google/ads/googleads/v16/enums/asset_group_primary_status.proto\x1a\x46google/ads/googleads/v16/enums/asset_group_primary_status_reason.proto\x1a\x37google/ads/googleads/v16/enums/asset_group_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x83\x06\n\nAssetGroup\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xe0\x41\x05\xfa\x41%\n#googleads.googleapis.com/AssetGroup\x12\x0f\n\x02id\x18\t \x01(\x03\x42\x03\xe0\x41\x03\x12;\n\x08\x63\x61mpaign\x18\x02 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/Campaign\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nfinal_urls\x18\x04 \x03(\t\x12\x19\n\x11\x66inal_mobile_urls\x18\x05 \x03(\t\x12U\n\x06status\x18\x06 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.AssetGroupStatusEnum.AssetGroupStatus\x12p\n\x0eprimary_status\x18\x0b \x01(\x0e\x32S.google.ads.googleads.v16.enums.AssetGroupPrimaryStatusEnum.AssetGroupPrimaryStatusB\x03\xe0\x41\x03\x12\x84\x01\n\x16primary_status_reasons\x18\x0c \x03(\x0e\x32_.google.ads.googleads.v16.enums.AssetGroupPrimaryStatusReasonEnum.AssetGroupPrimaryStatusReasonB\x03\xe0\x41\x03\x12\r\n\x05path1\x18\x07 \x01(\t\x12\r\n\x05path2\x18\x08 \x01(\t\x12S\n\x0b\x61\x64_strength\x18\n \x01(\x0e\x32\x39.google.ads.googleads.v16.enums.AdStrengthEnum.AdStrengthB\x03\xe0\x41\x03:^\xea\x41[\n#googleads.googleapis.com/AssetGroup\x12\x34\x63ustomers/{customer_id}/assetGroups/{asset_group_id}B\x81\x02\n&com.google.ads.googleads.v16.resourcesB\x0f\x41ssetGroupProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetGroup").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_group_product_group_view_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_group_product_group_view_pb.rb new file mode 100644 index 000000000..cc423dfa7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_group_product_group_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_group_product_group_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/resources/asset_group_product_group_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb7\x03\n\x1a\x41ssetGroupProductGroupView\x12R\n\rresource_name\x18\x01 \x01(\tB;\xe0\x41\x03\xfa\x41\x35\n3googleads.googleapis.com/AssetGroupProductGroupView\x12@\n\x0b\x61sset_group\x18\x02 \x01(\tB+\xe0\x41\x03\xfa\x41%\n#googleads.googleapis.com/AssetGroup\x12g\n asset_group_listing_group_filter\x18\x04 \x01(\tB=\xe0\x41\x03\xfa\x41\x37\n5googleads.googleapis.com/AssetGroupListingGroupFilter:\x99\x01\xea\x41\x95\x01\n3googleads.googleapis.com/AssetGroupProductGroupView\x12^customers/{customer_id}/assetGroupProductGroupViews/{asset_group_id}~{listing_group_filter_id}B\x91\x02\n&com.google.ads.googleads.v16.resourcesB\x1f\x41ssetGroupProductGroupViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetGroupProductGroupView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetGroupProductGroupView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_group_signal_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_group_signal_pb.rb new file mode 100644 index 000000000..059706afe --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_group_signal_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_group_signal.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/enums/asset_group_signal_approval_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/resources/asset_group_signal.proto\x12\"google.ads.googleads.v16.resources\x1a.google/ads/googleads/v16/common/criteria.proto\x1aGgoogle/ads/googleads/v16/enums/asset_group_signal_approval_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdd\x04\n\x10\x41ssetGroupSignal\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x05\xfa\x41+\n)googleads.googleapis.com/AssetGroupSignal\x12@\n\x0b\x61sset_group\x18\x02 \x01(\tB+\xe0\x41\x05\xfa\x41%\n#googleads.googleapis.com/AssetGroup\x12\x7f\n\x0f\x61pproval_status\x18\x06 \x01(\x0e\x32\x61.google.ads.googleads.v16.enums.AssetGroupSignalApprovalStatusEnum.AssetGroupSignalApprovalStatusB\x03\xe0\x41\x03\x12 \n\x13\x64isapproval_reasons\x18\x07 \x03(\tB\x03\xe0\x41\x03\x12\x46\n\x08\x61udience\x18\x04 \x01(\x0b\x32-.google.ads.googleads.v16.common.AudienceInfoB\x03\xe0\x41\x05H\x00\x12M\n\x0csearch_theme\x18\x05 \x01(\x0b\x32\x30.google.ads.googleads.v16.common.SearchThemeInfoB\x03\xe0\x41\x05H\x00:y\xea\x41v\n)googleads.googleapis.com/AssetGroupSignal\x12Icustomers/{customer_id}/assetGroupSignals/{asset_group_id}~{criterion_id}B\x08\n\x06signalB\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15\x41ssetGroupSignalProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AudienceInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetGroupSignal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetGroupSignal").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_group_top_combination_view_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_group_top_combination_view_pb.rb new file mode 100644 index 000000000..d79da09d2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_group_top_combination_view_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_group_top_combination_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/asset_usage_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nIgoogle/ads/googleads/v16/resources/asset_group_top_combination_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x31google/ads/googleads/v16/common/asset_usage.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x86\x03\n\x1c\x41ssetGroupTopCombinationView\x12T\n\rresource_name\x18\x01 \x01(\tB=\xe0\x41\x03\xfa\x41\x37\n5googleads.googleapis.com/AssetGroupTopCombinationView\x12m\n\x1c\x61sset_group_top_combinations\x18\x02 \x03(\x0b\x32\x42.google.ads.googleads.v16.resources.AssetGroupAssetCombinationDataB\x03\xe0\x41\x03:\xa0\x01\xea\x41\x9c\x01\n5googleads.googleapis.com/AssetGroupTopCombinationView\x12\x63\x63ustomers/{customer_id}/assetGroupTopCombinationViews/{asset_group_id}~{asset_combination_category}\"{\n\x1e\x41ssetGroupAssetCombinationData\x12Y\n\x1f\x61sset_combination_served_assets\x18\x01 \x03(\x0b\x32+.google.ads.googleads.v16.common.AssetUsageB\x03\xe0\x41\x03\x42\x93\x02\n&com.google.ads.googleads.v16.resourcesB!AssetGroupTopCombinationViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AssetUsage", "google/ads/googleads/v16/common/asset_usage.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetGroupTopCombinationView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetGroupTopCombinationView").msgclass + AssetGroupAssetCombinationData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetGroupAssetCombinationData").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_pb.rb new file mode 100644 index 000000000..5748cf0e1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/asset_types_pb' +require 'google/ads/google_ads/v16/common/custom_parameter_pb' +require 'google/ads/google_ads/v16/common/policy_pb' +require 'google/ads/google_ads/v16/enums/asset_field_type_pb' +require 'google/ads/google_ads/v16/enums/asset_source_pb' +require 'google/ads/google_ads/v16/enums/asset_type_pb' +require 'google/ads/google_ads/v16/enums/policy_approval_status_pb' +require 'google/ads/google_ads/v16/enums/policy_review_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n.google/ads/googleads/v16/resources/asset.proto\x12\"google.ads.googleads.v16.resources\x1a\x31google/ads/googleads/v16/common/asset_types.proto\x1a\x36google/ads/googleads/v16/common/custom_parameter.proto\x1a,google/ads/googleads/v16/common/policy.proto\x1a\x35google/ads/googleads/v16/enums/asset_field_type.proto\x1a\x31google/ads/googleads/v16/enums/asset_source.proto\x1a/google/ads/googleads/v16/enums/asset_type.proto\x1a;google/ads/googleads/v16/enums/policy_approval_status.proto\x1a\x39google/ads/googleads/v16/enums/policy_review_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xec\x17\n\x05\x41sset\x12=\n\rresource_name\x18\x01 \x01(\tB&\xe0\x41\x05\xfa\x41 \n\x1egoogleads.googleapis.com/Asset\x12\x14\n\x02id\x18\x0b \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x11\n\x04name\x18\x0c \x01(\tH\x02\x88\x01\x01\x12J\n\x04type\x18\x04 \x01(\x0e\x32\x37.google.ads.googleads.v16.enums.AssetTypeEnum.AssetTypeB\x03\xe0\x41\x03\x12\x12\n\nfinal_urls\x18\x0e \x03(\t\x12\x19\n\x11\x66inal_mobile_urls\x18\x10 \x03(\t\x12\"\n\x15tracking_url_template\x18\x11 \x01(\tH\x03\x88\x01\x01\x12O\n\x15url_custom_parameters\x18\x12 \x03(\x0b\x32\x30.google.ads.googleads.v16.common.CustomParameter\x12\x1d\n\x10\x66inal_url_suffix\x18\x13 \x01(\tH\x04\x88\x01\x01\x12P\n\x06source\x18& \x01(\x0e\x32;.google.ads.googleads.v16.enums.AssetSourceEnum.AssetSourceB\x03\xe0\x41\x03\x12S\n\x0epolicy_summary\x18\r \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.AssetPolicySummaryB\x03\xe0\x41\x03\x12i\n\x1b\x66ield_type_policy_summaries\x18( \x03(\x0b\x32?.google.ads.googleads.v16.resources.AssetFieldTypePolicySummaryB\x03\xe0\x41\x03\x12V\n\x13youtube_video_asset\x18\x05 \x01(\x0b\x32\x32.google.ads.googleads.v16.common.YoutubeVideoAssetB\x03\xe0\x41\x05H\x00\x12T\n\x12media_bundle_asset\x18\x06 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.MediaBundleAssetB\x03\xe0\x41\x05H\x00\x12G\n\x0bimage_asset\x18\x07 \x01(\x0b\x32+.google.ads.googleads.v16.common.ImageAssetB\x03\xe0\x41\x03H\x00\x12\x45\n\ntext_asset\x18\x08 \x01(\x0b\x32*.google.ads.googleads.v16.common.TextAssetB\x03\xe0\x41\x05H\x00\x12I\n\x0flead_form_asset\x18\t \x01(\x0b\x32..google.ads.googleads.v16.common.LeadFormAssetH\x00\x12R\n\x14\x62ook_on_google_asset\x18\n \x01(\x0b\x32\x32.google.ads.googleads.v16.common.BookOnGoogleAssetH\x00\x12J\n\x0fpromotion_asset\x18\x0f \x01(\x0b\x32/.google.ads.googleads.v16.common.PromotionAssetH\x00\x12\x46\n\rcallout_asset\x18\x14 \x01(\x0b\x32-.google.ads.googleads.v16.common.CalloutAssetH\x00\x12[\n\x18structured_snippet_asset\x18\x15 \x01(\x0b\x32\x37.google.ads.googleads.v16.common.StructuredSnippetAssetH\x00\x12H\n\x0esitelink_asset\x18\x16 \x01(\x0b\x32..google.ads.googleads.v16.common.SitelinkAssetH\x00\x12I\n\x0fpage_feed_asset\x18\x17 \x01(\x0b\x32..google.ads.googleads.v16.common.PageFeedAssetH\x00\x12Y\n\x17\x64ynamic_education_asset\x18\x18 \x01(\x0b\x32\x36.google.ads.googleads.v16.common.DynamicEducationAssetH\x00\x12K\n\x10mobile_app_asset\x18\x19 \x01(\x0b\x32/.google.ads.googleads.v16.common.MobileAppAssetH\x00\x12Q\n\x13hotel_callout_asset\x18\x1a \x01(\x0b\x32\x32.google.ads.googleads.v16.common.HotelCalloutAssetH\x00\x12@\n\ncall_asset\x18\x1b \x01(\x0b\x32*.google.ads.googleads.v16.common.CallAssetH\x00\x12\x42\n\x0bprice_asset\x18\x1c \x01(\x0b\x32+.google.ads.googleads.v16.common.PriceAssetH\x00\x12W\n\x14\x63\x61ll_to_action_asset\x18\x1d \x01(\x0b\x32\x32.google.ads.googleads.v16.common.CallToActionAssetB\x03\xe0\x41\x05H\x00\x12\\\n\x19\x64ynamic_real_estate_asset\x18\x1e \x01(\x0b\x32\x37.google.ads.googleads.v16.common.DynamicRealEstateAssetH\x00\x12S\n\x14\x64ynamic_custom_asset\x18\x1f \x01(\x0b\x32\x33.google.ads.googleads.v16.common.DynamicCustomAssetH\x00\x12i\n dynamic_hotels_and_rentals_asset\x18 \x01(\x0b\x32=.google.ads.googleads.v16.common.DynamicHotelsAndRentalsAssetH\x00\x12U\n\x15\x64ynamic_flights_asset\x18! \x01(\x0b\x32\x34.google.ads.googleads.v16.common.DynamicFlightsAssetH\x00\x12i\n\x1d\x64iscovery_carousel_card_asset\x18\" \x01(\x0b\x32;.google.ads.googleads.v16.common.DiscoveryCarouselCardAssetB\x03\xe0\x41\x05H\x00\x12S\n\x14\x64ynamic_travel_asset\x18# \x01(\x0b\x32\x33.google.ads.googleads.v16.common.DynamicTravelAssetH\x00\x12Q\n\x13\x64ynamic_local_asset\x18$ \x01(\x0b\x32\x32.google.ads.googleads.v16.common.DynamicLocalAssetH\x00\x12O\n\x12\x64ynamic_jobs_asset\x18% \x01(\x0b\x32\x31.google.ads.googleads.v16.common.DynamicJobsAssetH\x00\x12M\n\x0elocation_asset\x18\' \x01(\x0b\x32..google.ads.googleads.v16.common.LocationAssetB\x03\xe0\x41\x03H\x00\x12X\n\x14hotel_property_asset\x18) \x01(\x0b\x32\x33.google.ads.googleads.v16.common.HotelPropertyAssetB\x03\xe0\x41\x05H\x00:N\xea\x41K\n\x1egoogleads.googleapis.com/Asset\x12)customers/{customer_id}/assets/{asset_id}B\x0c\n\nasset_dataB\x05\n\x03_idB\x07\n\x05_nameB\x18\n\x16_tracking_url_templateB\x13\n\x11_final_url_suffix\"\xfe\x02\n\x1b\x41ssetFieldTypePolicySummary\x12\x65\n\x10\x61sset_field_type\x18\x01 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetFieldTypeEnum.AssetFieldTypeB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12[\n\x0c\x61sset_source\x18\x02 \x01(\x0e\x32;.google.ads.googleads.v16.enums.AssetSourceEnum.AssetSourceB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12]\n\x13policy_summary_info\x18\x03 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.AssetPolicySummaryB\x03\xe0\x41\x03H\x02\x88\x01\x01\x42\x13\n\x11_asset_field_typeB\x0f\n\r_asset_sourceB\x16\n\x14_policy_summary_info\"\xbe\x02\n\x12\x41ssetPolicySummary\x12T\n\x14policy_topic_entries\x18\x01 \x03(\x0b\x32\x31.google.ads.googleads.v16.common.PolicyTopicEntryB\x03\xe0\x41\x03\x12\x65\n\rreview_status\x18\x02 \x01(\x0e\x32I.google.ads.googleads.v16.enums.PolicyReviewStatusEnum.PolicyReviewStatusB\x03\xe0\x41\x03\x12k\n\x0f\x61pproval_status\x18\x03 \x01(\x0e\x32M.google.ads.googleads.v16.enums.PolicyApprovalStatusEnum.PolicyApprovalStatusB\x03\xe0\x41\x03\x42\xfc\x01\n&com.google.ads.googleads.v16.resourcesB\nAssetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CustomParameter", "google/ads/googleads/v16/common/custom_parameter.proto"], + ["google.ads.googleads.v16.common.YoutubeVideoAsset", "google/ads/googleads/v16/common/asset_types.proto"], + ["google.ads.googleads.v16.common.PolicyTopicEntry", "google/ads/googleads/v16/common/policy.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Asset").msgclass + AssetFieldTypePolicySummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetFieldTypePolicySummary").msgclass + AssetPolicySummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetPolicySummary").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_set_asset_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_set_asset_pb.rb new file mode 100644 index 000000000..ac25df8af --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_set_asset_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_set_asset.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/asset_set_asset_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/resources/asset_set_asset.proto\x12\"google.ads.googleads.v16.resources\x1a;google/ads/googleads/v16/enums/asset_set_asset_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9c\x03\n\rAssetSetAsset\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xe0\x41\x05\xfa\x41(\n&googleads.googleapis.com/AssetSetAsset\x12<\n\tasset_set\x18\x02 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/AssetSet\x12\x35\n\x05\x61sset\x18\x03 \x01(\tB&\xe0\x41\x05\xfa\x41 \n\x1egoogleads.googleapis.com/Asset\x12`\n\x06status\x18\x04 \x01(\x0e\x32K.google.ads.googleads.v16.enums.AssetSetAssetStatusEnum.AssetSetAssetStatusB\x03\xe0\x41\x03:m\xea\x41j\n&googleads.googleapis.com/AssetSetAsset\x12@customers/{customer_id}/assetSetAssets/{asset_set_id}~{asset_id}B\x84\x02\n&com.google.ads.googleads.v16.resourcesB\x12\x41ssetSetAssetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetSetAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetSetAsset").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_set_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_set_pb.rb new file mode 100644 index 000000000..4375673d9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_set_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_set.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/asset_set_types_pb' +require 'google/ads/google_ads/v16/enums/asset_set_status_pb' +require 'google/ads/google_ads/v16/enums/asset_set_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n2google/ads/googleads/v16/resources/asset_set.proto\x12\"google.ads.googleads.v16.resources\x1a\x35google/ads/googleads/v16/common/asset_set_types.proto\x1a\x35google/ads/googleads/v16/enums/asset_set_status.proto\x1a\x33google/ads/googleads/v16/enums/asset_set_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdc\x08\n\x08\x41ssetSet\x12\x0f\n\x02id\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03\x12@\n\rresource_name\x18\x01 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/AssetSet\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12S\n\x04type\x18\x03 \x01(\x0e\x32=.google.ads.googleads.v16.enums.AssetSetTypeEnum.AssetSetTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12V\n\x06status\x18\x04 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetSetStatusEnum.AssetSetStatusB\x03\xe0\x41\x03\x12]\n\x14merchant_center_feed\x18\x05 \x01(\x0b\x32?.google.ads.googleads.v16.resources.AssetSet.MerchantCenterFeed\x12/\n\"location_group_parent_asset_set_id\x18\n \x01(\x03\x42\x03\xe0\x41\x05\x12`\n\x13hotel_property_data\x18\x0b \x01(\x0b\x32>.google.ads.googleads.v16.resources.AssetSet.HotelPropertyDataB\x03\xe0\x41\x03\x12\x44\n\x0clocation_set\x18\x07 \x01(\x0b\x32,.google.ads.googleads.v16.common.LocationSetH\x00\x12h\n\x1f\x62usiness_profile_location_group\x18\x08 \x01(\x0b\x32=.google.ads.googleads.v16.common.BusinessProfileLocationGroupH\x00\x12S\n\x14\x63hain_location_group\x18\t \x01(\x0b\x32\x33.google.ads.googleads.v16.common.ChainLocationGroupH\x00\x1a[\n\x12MerchantCenterFeed\x12\x18\n\x0bmerchant_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\x1c\n\nfeed_label\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\r\n\x0b_feed_label\x1a{\n\x11HotelPropertyData\x12!\n\x0fhotel_center_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1e\n\x0cpartner_name\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x12\n\x10_hotel_center_idB\x0f\n\r_partner_name:X\xea\x41U\n!googleads.googleapis.com/AssetSet\x12\x30\x63ustomers/{customer_id}/assetSets/{asset_set_id}B\x12\n\x10\x61sset_set_sourceB\xff\x01\n&com.google.ads.googleads.v16.resourcesB\rAssetSetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.LocationSet", "google/ads/googleads/v16/common/asset_set_types.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + AssetSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetSet").msgclass + AssetSet::MerchantCenterFeed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetSet.MerchantCenterFeed").msgclass + AssetSet::HotelPropertyData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AssetSet.HotelPropertyData").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/asset_set_type_view_pb.rb b/lib/google/ads/google_ads/v16/resources/asset_set_type_view_pb.rb new file mode 100644 index 000000000..7b2aa1536 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/asset_set_type_view_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/asset_set_type_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/asset_set_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n.google.ads.googleads.v16.common.TargetRoasSimulationPointListB\x03\xe0\x41\x03H\x00:\xb7\x01\xea\x41\xb3\x01\n2googleads.googleapis.com/BiddingStrategySimulation\x12}customers/{customer_id}/biddingStrategySimulations/{bidding_strategy_id}~{type}~{modification_method}~{start_date}~{end_date}B\x0c\n\npoint_listB\x90\x02\n&com.google.ads.googleads.v16.resourcesB\x1e\x42iddingStrategySimulationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.TargetCpaSimulationPointList", "google/ads/googleads/v16/common/simulation.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + BiddingStrategySimulation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.BiddingStrategySimulation").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/billing_setup_pb.rb b/lib/google/ads/google_ads/v16/resources/billing_setup_pb.rb new file mode 100644 index 000000000..d411f6176 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/billing_setup_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/billing_setup.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/billing_setup_status_pb' +require 'google/ads/google_ads/v16/enums/time_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n6google/ads/googleads/v16/resources/billing_setup.proto\x12\"google.ads.googleads.v16.resources\x1a\x39google/ads/googleads/v16/enums/billing_setup_status.proto\x1a.google/ads/googleads/v16/enums/time_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xfa\x08\n\x0c\x42illingSetup\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xe0\x41\x05\xfa\x41\'\n%googleads.googleapis.com/BillingSetup\x12\x14\n\x02id\x18\x0f \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12^\n\x06status\x18\x03 \x01(\x0e\x32I.google.ads.googleads.v16.enums.BillingSetupStatusEnum.BillingSetupStatusB\x03\xe0\x41\x03\x12O\n\x10payments_account\x18\x12 \x01(\tB0\xe0\x41\x05\xfa\x41*\n(googleads.googleapis.com/PaymentsAccountH\x03\x88\x01\x01\x12h\n\x15payments_account_info\x18\x0c \x01(\x0b\x32\x44.google.ads.googleads.v16.resources.BillingSetup.PaymentsAccountInfoB\x03\xe0\x41\x05\x12\x1e\n\x0fstart_date_time\x18\x10 \x01(\tB\x03\xe0\x41\x05H\x00\x12U\n\x0fstart_time_type\x18\n \x01(\x0e\x32\x35.google.ads.googleads.v16.enums.TimeTypeEnum.TimeTypeB\x03\xe0\x41\x05H\x00\x12\x1c\n\rend_date_time\x18\x11 \x01(\tB\x03\xe0\x41\x03H\x01\x12S\n\rend_time_type\x18\x0e \x01(\x0e\x32\x35.google.ads.googleads.v16.enums.TimeTypeEnum.TimeTypeB\x03\xe0\x41\x03H\x01\x1a\xec\x02\n\x13PaymentsAccountInfo\x12%\n\x13payments_account_id\x18\x06 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\'\n\x15payments_account_name\x18\x07 \x01(\tB\x03\xe0\x41\x05H\x01\x88\x01\x01\x12%\n\x13payments_profile_id\x18\x08 \x01(\tB\x03\xe0\x41\x05H\x02\x88\x01\x01\x12\'\n\x15payments_profile_name\x18\t \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12/\n\x1dsecondary_payments_profile_id\x18\n \x01(\tB\x03\xe0\x41\x03H\x04\x88\x01\x01\x42\x16\n\x14_payments_account_idB\x18\n\x16_payments_account_nameB\x16\n\x14_payments_profile_idB\x18\n\x16_payments_profile_nameB \n\x1e_secondary_payments_profile_id:d\xea\x41\x61\n%googleads.googleapis.com/BillingSetup\x12\x38\x63ustomers/{customer_id}/billingSetups/{billing_setup_id}B\x0c\n\nstart_timeB\n\n\x08\x65nd_timeB\x05\n\x03_idB\x13\n\x11_payments_accountB\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11\x42illingSetupProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + BillingSetup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.BillingSetup").msgclass + BillingSetup::PaymentsAccountInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.BillingSetup.PaymentsAccountInfo").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/call_view_pb.rb b/lib/google/ads/google_ads/v16/resources/call_view_pb.rb new file mode 100644 index 000000000..d2758a71c --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/call_view_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/call_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/call_tracking_display_location_pb' +require 'google/ads/google_ads/v16/enums/call_type_pb' +require 'google/ads/google_ads/v16/enums/google_voice_call_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n2google/ads/googleads/v16/resources/call_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x43google/ads/googleads/v16/enums/call_tracking_display_location.proto\x1a.google/ads/googleads/v16/enums/call_type.proto\x1a=google/ads/googleads/v16/enums/google_voice_call_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x91\x05\n\x08\x43\x61llView\x12@\n\rresource_name\x18\x01 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/CallView\x12 \n\x13\x63\x61ller_country_code\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10\x63\x61ller_area_code\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\"\n\x15\x63\x61ll_duration_seconds\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12!\n\x14start_call_date_time\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12\x65nd_call_date_time\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x88\x01\n\x1e\x63\x61ll_tracking_display_location\x18\x07 \x01(\x0e\x32[.google.ads.googleads.v16.enums.CallTrackingDisplayLocationEnum.CallTrackingDisplayLocationB\x03\xe0\x41\x03\x12H\n\x04type\x18\x08 \x01(\x0e\x32\x35.google.ads.googleads.v16.enums.CallTypeEnum.CallTypeB\x03\xe0\x41\x03\x12i\n\x0b\x63\x61ll_status\x18\t \x01(\x0e\x32O.google.ads.googleads.v16.enums.GoogleVoiceCallStatusEnum.GoogleVoiceCallStatusB\x03\xe0\x41\x03:Z\xea\x41W\n!googleads.googleapis.com/CallView\x12\x32\x63ustomers/{customer_id}/callViews/{call_detail_id}B\xff\x01\n&com.google.ads.googleads.v16.resourcesB\rCallViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CallView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CallView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/campaign_asset_pb.rb b/lib/google/ads/google_ads/v16/resources/campaign_asset_pb.rb new file mode 100644 index 000000000..99d3ad5c6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/campaign_asset_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/campaign_asset.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/asset_policy_pb' +require 'google/ads/google_ads/v16/enums/asset_field_type_pb' +require 'google/ads/google_ads/v16/enums/asset_link_primary_status_pb' +require 'google/ads/google_ads/v16/enums/asset_link_primary_status_reason_pb' +require 'google/ads/google_ads/v16/enums/asset_link_status_pb' +require 'google/ads/google_ads/v16/enums/asset_source_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n7google/ads/googleads/v16/resources/campaign_asset.proto\x12\"google.ads.googleads.v16.resources\x1a\x32google/ads/googleads/v16/common/asset_policy.proto\x1a\x35google/ads/googleads/v16/enums/asset_field_type.proto\x1a>google/ads/googleads/v16/enums/asset_link_primary_status.proto\x1a\x45google/ads/googleads/v16/enums/asset_link_primary_status_reason.proto\x1a\x36google/ads/googleads/v16/enums/asset_link_status.proto\x1a\x31google/ads/googleads/v16/enums/asset_source.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc3\x07\n\rCampaignAsset\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xe0\x41\x05\xfa\x41(\n&googleads.googleapis.com/CampaignAsset\x12@\n\x08\x63\x61mpaign\x18\x06 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/CampaignH\x00\x88\x01\x01\x12:\n\x05\x61sset\x18\x07 \x01(\tB&\xe0\x41\x05\xfa\x41 \n\x1egoogleads.googleapis.com/AssetH\x01\x88\x01\x01\x12Z\n\nfield_type\x18\x04 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetFieldTypeEnum.AssetFieldTypeB\x03\xe0\x41\x05\x12P\n\x06source\x18\x08 \x01(\x0e\x32;.google.ads.googleads.v16.enums.AssetSourceEnum.AssetSourceB\x03\xe0\x41\x03\x12S\n\x06status\x18\x05 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.AssetLinkStatusEnum.AssetLinkStatus\x12n\n\x0eprimary_status\x18\t \x01(\x0e\x32Q.google.ads.googleads.v16.enums.AssetLinkPrimaryStatusEnum.AssetLinkPrimaryStatusB\x03\xe0\x41\x03\x12\x63\n\x16primary_status_details\x18\n \x03(\x0b\x32>.google.ads.googleads.v16.common.AssetLinkPrimaryStatusDetailsB\x03\xe0\x41\x03\x12\x82\x01\n\x16primary_status_reasons\x18\x0b \x03(\x0e\x32].google.ads.googleads.v16.enums.AssetLinkPrimaryStatusReasonEnum.AssetLinkPrimaryStatusReasonB\x03\xe0\x41\x03:y\xea\x41v\n&googleads.googleapis.com/CampaignAsset\x12Lcustomers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}B\x0b\n\t_campaignB\x08\n\x06_assetB\x84\x02\n&com.google.ads.googleads.v16.resourcesB\x12\x43\x61mpaignAssetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AssetLinkPrimaryStatusDetails", "google/ads/googleads/v16/common/asset_policy.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CampaignAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CampaignAsset").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/campaign_asset_set_pb.rb b/lib/google/ads/google_ads/v16/resources/campaign_asset_set_pb.rb new file mode 100644 index 000000000..75eae9f2d --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/campaign_asset_set_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/campaign_asset_set.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/asset_set_link_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/resources/campaign_asset_set.proto\x12\"google.ads.googleads.v16.resources\x1a:google/ads/googleads/v16/enums/asset_set_link_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xaf\x03\n\x10\x43\x61mpaignAssetSet\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x05\xfa\x41+\n)googleads.googleapis.com/CampaignAssetSet\x12;\n\x08\x63\x61mpaign\x18\x02 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/Campaign\x12<\n\tasset_set\x18\x03 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/AssetSet\x12^\n\x06status\x18\x04 \x01(\x0e\x32I.google.ads.googleads.v16.enums.AssetSetLinkStatusEnum.AssetSetLinkStatusB\x03\xe0\x41\x03:v\xea\x41s\n)googleads.googleapis.com/CampaignAssetSet\x12\x46\x63ustomers/{customer_id}/campaignAssetSets/{campaign_id}~{asset_set_id}B\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15\x43\x61mpaignAssetSetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CampaignAssetSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CampaignAssetSet").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/campaign_audience_view_pb.rb b/lib/google/ads/google_ads/v16/resources/campaign_audience_view_pb.rb new file mode 100644 index 000000000..0092a4d7a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/campaign_audience_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/campaign_audience_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/resources/campaign_audience_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe4\x01\n\x14\x43\x61mpaignAudienceView\x12L\n\rresource_name\x18\x01 \x01(\tB5\xe0\x41\x03\xfa\x41/\n-googleads.googleapis.com/CampaignAudienceView:~\xea\x41{\n-googleads.googleapis.com/CampaignAudienceView\x12Jcustomers/{customer_id}/campaignAudienceViews/{campaign_id}~{criterion_id}B\x8b\x02\n&com.google.ads.googleads.v16.resourcesB\x19\x43\x61mpaignAudienceViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CampaignAudienceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CampaignAudienceView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/campaign_bid_modifier_pb.rb b/lib/google/ads/google_ads/v16/resources/campaign_bid_modifier_pb.rb new file mode 100644 index 000000000..ee82c758c --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/campaign_bid_modifier_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/campaign_bid_modifier.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/resources/campaign_bid_modifier.proto\x12\"google.ads.googleads.v16.resources\x1a.google/ads/googleads/v16/common/criteria.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf0\x03\n\x13\x43\x61mpaignBidModifier\x12K\n\rresource_name\x18\x01 \x01(\tB4\xe0\x41\x05\xfa\x41.\n,googleads.googleapis.com/CampaignBidModifier\x12@\n\x08\x63\x61mpaign\x18\x06 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/CampaignH\x01\x88\x01\x01\x12\x1e\n\x0c\x63riterion_id\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x19\n\x0c\x62id_modifier\x18\x08 \x01(\x01H\x03\x88\x01\x01\x12U\n\x10interaction_type\x18\x05 \x01(\x0b\x32\x34.google.ads.googleads.v16.common.InteractionTypeInfoB\x03\xe0\x41\x05H\x00:|\xea\x41y\n,googleads.googleapis.com/CampaignBidModifier\x12Icustomers/{customer_id}/campaignBidModifiers/{campaign_id}~{criterion_id}B\x0b\n\tcriterionB\x0b\n\t_campaignB\x0f\n\r_criterion_idB\x0f\n\r_bid_modifierB\x8a\x02\n&com.google.ads.googleads.v16.resourcesB\x18\x43\x61mpaignBidModifierProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.InteractionTypeInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CampaignBidModifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CampaignBidModifier").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/campaign_budget_pb.rb b/lib/google/ads/google_ads/v16/resources/campaign_budget_pb.rb new file mode 100644 index 000000000..541d747c9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/campaign_budget_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/campaign_budget.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/budget_delivery_method_pb' +require 'google/ads/google_ads/v16/enums/budget_period_pb' +require 'google/ads/google_ads/v16/enums/budget_status_pb' +require 'google/ads/google_ads/v16/enums/budget_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/resources/campaign_budget.proto\x12\"google.ads.googleads.v16.resources\x1a;google/ads/googleads/v16/enums/budget_delivery_method.proto\x1a\x32google/ads/googleads/v16/enums/budget_period.proto\x1a\x32google/ads/googleads/v16/enums/budget_status.proto\x1a\x30google/ads/googleads/v16/enums/budget_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf3\x0b\n\x0e\x43\x61mpaignBudget\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x05\xfa\x41)\n\'googleads.googleapis.com/CampaignBudget\x12\x14\n\x02id\x18\x13 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x11\n\x04name\x18\x14 \x01(\tH\x01\x88\x01\x01\x12\x1a\n\ramount_micros\x18\x15 \x01(\x03H\x02\x88\x01\x01\x12 \n\x13total_amount_micros\x18\x16 \x01(\x03H\x03\x88\x01\x01\x12R\n\x06status\x18\x06 \x01(\x0e\x32=.google.ads.googleads.v16.enums.BudgetStatusEnum.BudgetStatusB\x03\xe0\x41\x03\x12\x66\n\x0f\x64\x65livery_method\x18\x07 \x01(\x0e\x32M.google.ads.googleads.v16.enums.BudgetDeliveryMethodEnum.BudgetDeliveryMethod\x12\x1e\n\x11\x65xplicitly_shared\x18\x17 \x01(\x08H\x04\x88\x01\x01\x12!\n\x0freference_count\x18\x18 \x01(\x03\x42\x03\xe0\x41\x03H\x05\x88\x01\x01\x12(\n\x16has_recommended_budget\x18\x19 \x01(\x08\x42\x03\xe0\x41\x03H\x06\x88\x01\x01\x12\x32\n recommended_budget_amount_micros\x18\x1a \x01(\x03\x42\x03\xe0\x41\x03H\x07\x88\x01\x01\x12R\n\x06period\x18\r \x01(\x0e\x32=.google.ads.googleads.v16.enums.BudgetPeriodEnum.BudgetPeriodB\x03\xe0\x41\x05\x12\x43\n1recommended_budget_estimated_change_weekly_clicks\x18\x1b \x01(\x03\x42\x03\xe0\x41\x03H\x08\x88\x01\x01\x12H\n6recommended_budget_estimated_change_weekly_cost_micros\x18\x1c \x01(\x03\x42\x03\xe0\x41\x03H\t\x88\x01\x01\x12I\n7recommended_budget_estimated_change_weekly_interactions\x18\x1d \x01(\x03\x42\x03\xe0\x41\x03H\n\x88\x01\x01\x12\x42\n0recommended_budget_estimated_change_weekly_views\x18\x1e \x01(\x03\x42\x03\xe0\x41\x03H\x0b\x88\x01\x01\x12L\n\x04type\x18\x12 \x01(\x0e\x32\x39.google.ads.googleads.v16.enums.BudgetTypeEnum.BudgetTypeB\x03\xe0\x41\x05\x12#\n\x1b\x61ligned_bidding_strategy_id\x18\x1f \x01(\x03:j\xea\x41g\n\'googleads.googleapis.com/CampaignBudget\x12google/ads/googleads/v16/enums/campaign_criterion_status.proto\x1a\x33google/ads/googleads/v16/enums/criterion_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe5\x18\n\x11\x43\x61mpaignCriterion\x12I\n\rresource_name\x18\x01 \x01(\tB2\xe0\x41\x05\xfa\x41,\n*googleads.googleapis.com/CampaignCriterion\x12@\n\x08\x63\x61mpaign\x18% \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/CampaignH\x01\x88\x01\x01\x12\x1e\n\x0c\x63riterion_id\x18& \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x19\n\x0c\x64isplay_name\x18+ \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x62id_modifier\x18\' \x01(\x02H\x03\x88\x01\x01\x12\x1a\n\x08negative\x18( \x01(\x08\x42\x03\xe0\x41\x05H\x04\x88\x01\x01\x12R\n\x04type\x18\x06 \x01(\x0e\x32?.google.ads.googleads.v16.enums.CriterionTypeEnum.CriterionTypeB\x03\xe0\x41\x03\x12\x63\n\x06status\x18# \x01(\x0e\x32S.google.ads.googleads.v16.enums.CampaignCriterionStatusEnum.CampaignCriterionStatus\x12\x44\n\x07keyword\x18\x08 \x01(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x05H\x00\x12H\n\tplacement\x18\t \x01(\x0b\x32..google.ads.googleads.v16.common.PlacementInfoB\x03\xe0\x41\x05H\x00\x12Z\n\x13mobile_app_category\x18\n \x01(\x0b\x32\x36.google.ads.googleads.v16.common.MobileAppCategoryInfoB\x03\xe0\x41\x05H\x00\x12Y\n\x12mobile_application\x18\x0b \x01(\x0b\x32\x36.google.ads.googleads.v16.common.MobileApplicationInfoB\x03\xe0\x41\x05H\x00\x12\x46\n\x08location\x18\x0c \x01(\x0b\x32-.google.ads.googleads.v16.common.LocationInfoB\x03\xe0\x41\x05H\x00\x12\x42\n\x06\x64\x65vice\x18\r \x01(\x0b\x32+.google.ads.googleads.v16.common.DeviceInfoB\x03\xe0\x41\x05H\x00\x12K\n\x0b\x61\x64_schedule\x18\x0f \x01(\x0b\x32/.google.ads.googleads.v16.common.AdScheduleInfoB\x03\xe0\x41\x05H\x00\x12G\n\tage_range\x18\x10 \x01(\x0b\x32-.google.ads.googleads.v16.common.AgeRangeInfoB\x03\xe0\x41\x05H\x00\x12\x42\n\x06gender\x18\x11 \x01(\x0b\x32+.google.ads.googleads.v16.common.GenderInfoB\x03\xe0\x41\x05H\x00\x12M\n\x0cincome_range\x18\x12 \x01(\x0b\x32\x30.google.ads.googleads.v16.common.IncomeRangeInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0fparental_status\x18\x13 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.ParentalStatusInfoB\x03\xe0\x41\x05H\x00\x12G\n\tuser_list\x18\x16 \x01(\x0b\x32-.google.ads.googleads.v16.common.UserListInfoB\x03\xe0\x41\x05H\x00\x12O\n\ryoutube_video\x18\x14 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.YouTubeVideoInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0fyoutube_channel\x18\x15 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.YouTubeChannelInfoB\x03\xe0\x41\x05H\x00\x12H\n\tproximity\x18\x17 \x01(\x0b\x32..google.ads.googleads.v16.common.ProximityInfoB\x03\xe0\x41\x05H\x00\x12@\n\x05topic\x18\x18 \x01(\x0b\x32*.google.ads.googleads.v16.common.TopicInfoB\x03\xe0\x41\x05H\x00\x12O\n\rlisting_scope\x18\x19 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.ListingScopeInfoB\x03\xe0\x41\x05H\x00\x12\x46\n\x08language\x18\x1a \x01(\x0b\x32-.google.ads.googleads.v16.common.LanguageInfoB\x03\xe0\x41\x05H\x00\x12\x45\n\x08ip_block\x18\x1b \x01(\x0b\x32,.google.ads.googleads.v16.common.IpBlockInfoB\x03\xe0\x41\x05H\x00\x12O\n\rcontent_label\x18\x1c \x01(\x0b\x32\x31.google.ads.googleads.v16.common.ContentLabelInfoB\x03\xe0\x41\x05H\x00\x12\x44\n\x07\x63\x61rrier\x18\x1d \x01(\x0b\x32,.google.ads.googleads.v16.common.CarrierInfoB\x03\xe0\x41\x05H\x00\x12O\n\ruser_interest\x18\x1e \x01(\x0b\x32\x31.google.ads.googleads.v16.common.UserInterestInfoB\x03\xe0\x41\x05H\x00\x12\x44\n\x07webpage\x18\x1f \x01(\x0b\x32,.google.ads.googleads.v16.common.WebpageInfoB\x03\xe0\x41\x05H\x00\x12\x64\n\x18operating_system_version\x18 \x01(\x0b\x32;.google.ads.googleads.v16.common.OperatingSystemVersionInfoB\x03\xe0\x41\x05H\x00\x12O\n\rmobile_device\x18! \x01(\x0b\x32\x31.google.ads.googleads.v16.common.MobileDeviceInfoB\x03\xe0\x41\x05H\x00\x12Q\n\x0elocation_group\x18\" \x01(\x0b\x32\x32.google.ads.googleads.v16.common.LocationGroupInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0f\x63ustom_affinity\x18$ \x01(\x0b\x32\x33.google.ads.googleads.v16.common.CustomAffinityInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0f\x63ustom_audience\x18) \x01(\x0b\x32\x33.google.ads.googleads.v16.common.CustomAudienceInfoB\x03\xe0\x41\x05H\x00\x12W\n\x11\x63ombined_audience\x18* \x01(\x0b\x32\x35.google.ads.googleads.v16.common.CombinedAudienceInfoB\x03\xe0\x41\x05H\x00\x12O\n\rkeyword_theme\x18- \x01(\x0b\x32\x31.google.ads.googleads.v16.common.KeywordThemeInfoB\x03\xe0\x41\x05H\x00\x12T\n\x10local_service_id\x18. \x01(\x0b\x32\x33.google.ads.googleads.v16.common.LocalServiceIdInfoB\x03\xe0\x41\x05H\x00\x12I\n\nbrand_list\x18/ \x01(\x0b\x32..google.ads.googleads.v16.common.BrandListInfoB\x03\xe0\x41\x05H\x00:v\xea\x41s\n*googleads.googleapis.com/CampaignCriterion\x12\x45\x63ustomers/{customer_id}/campaignCriteria/{campaign_id}~{criterion_id}B\x0b\n\tcriterionB\x0b\n\t_campaignB\x0f\n\r_criterion_idB\x0f\n\r_bid_modifierB\x0b\n\t_negativeB\x88\x02\n&com.google.ads.googleads.v16.resourcesB\x16\x43\x61mpaignCriterionProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.KeywordInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CampaignCriterion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CampaignCriterion").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/campaign_customizer_pb.rb b/lib/google/ads/google_ads/v16/resources/campaign_customizer_pb.rb new file mode 100644 index 000000000..6533c0bce --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/campaign_customizer_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/campaign_customizer.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/customizer_value_pb' +require 'google/ads/google_ads/v16/enums/customizer_value_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n\n\x06labels\x18= \x03(\tB.\xe0\x41\x03\xfa\x41(\n&googleads.googleapis.com/CampaignLabel\x12o\n\x0f\x65xperiment_type\x18\x11 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.CampaignExperimentTypeEnum.CampaignExperimentTypeB\x03\xe0\x41\x03\x12\x45\n\rbase_campaign\x18\x38 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/CampaignH\x05\x88\x01\x01\x12J\n\x0f\x63\x61mpaign_budget\x18> \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/CampaignBudgetH\x06\x88\x01\x01\x12o\n\x15\x62idding_strategy_type\x18\x16 \x01(\x0e\x32K.google.ads.googleads.v16.enums.BiddingStrategyTypeEnum.BiddingStrategyTypeB\x03\xe0\x41\x03\x12_\n\x1b\x61\x63\x63\x65ssible_bidding_strategy\x18G \x01(\tB:\xe0\x41\x03\xfa\x41\x34\n2googleads.googleapis.com/AccessibleBiddingStrategy\x12\x17\n\nstart_date\x18? \x01(\tH\x07\x88\x01\x01\x12H\n\x0e\x63\x61mpaign_group\x18L \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CampaignGroupH\x08\x88\x01\x01\x12\x15\n\x08\x65nd_date\x18@ \x01(\tH\t\x88\x01\x01\x12\x1d\n\x10\x66inal_url_suffix\x18\x41 \x01(\tH\n\x88\x01\x01\x12J\n\x0e\x66requency_caps\x18( \x03(\x0b\x32\x32.google.ads.googleads.v16.common.FrequencyCapEntry\x12~\n\x1evideo_brand_safety_suitability\x18* \x01(\x0e\x32Q.google.ads.googleads.v16.enums.BrandSafetySuitabilityEnum.BrandSafetySuitabilityB\x03\xe0\x41\x03\x12P\n\rvanity_pharma\x18, \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.Campaign.VanityPharma\x12\x62\n\x16selective_optimization\x18- \x01(\x0b\x32\x42.google.ads.googleads.v16.resources.Campaign.SelectiveOptimization\x12g\n\x19optimization_goal_setting\x18\x36 \x01(\x0b\x32\x44.google.ads.googleads.v16.resources.Campaign.OptimizationGoalSetting\x12[\n\x10tracking_setting\x18. \x01(\x0b\x32<.google.ads.googleads.v16.resources.Campaign.TrackingSettingB\x03\xe0\x41\x03\x12Q\n\x0cpayment_mode\x18\x34 \x01(\x0e\x32;.google.ads.googleads.v16.enums.PaymentModeEnum.PaymentMode\x12$\n\x12optimization_score\x18\x42 \x01(\x01\x42\x03\xe0\x41\x03H\x0b\x88\x01\x01\x12l\n!excluded_parent_asset_field_types\x18\x45 \x03(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetFieldTypeEnum.AssetFieldType\x12\x66\n\x1f\x65xcluded_parent_asset_set_types\x18P \x03(\x0e\x32=.google.ads.googleads.v16.enums.AssetSetTypeEnum.AssetSetType\x12\"\n\x15url_expansion_opt_out\x18H \x01(\x08H\x0c\x88\x01\x01\x12h\n\x17performance_max_upgrade\x18M \x01(\x0b\x32\x42.google.ads.googleads.v16.resources.Campaign.PerformanceMaxUpgradeB\x03\xe0\x41\x03\x12P\n\x18hotel_property_asset_set\x18S \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/AssetSetH\r\x88\x01\x01\x12[\n\x0clisting_type\x18V \x01(\x0e\x32;.google.ads.googleads.v16.enums.ListingTypeEnum.ListingTypeB\x03\xe0\x41\x05H\x0e\x88\x01\x01\x12\x66\n\x19\x61sset_automation_settings\x18X \x03(\x0b\x32\x43.google.ads.googleads.v16.resources.Campaign.AssetAutomationSetting\x12I\n\x10\x62idding_strategy\x18\x43 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/BiddingStrategyH\x00\x12\x41\n\ncommission\x18\x31 \x01(\x0b\x32+.google.ads.googleads.v16.common.CommissionH\x00\x12@\n\nmanual_cpa\x18J \x01(\x0b\x32*.google.ads.googleads.v16.common.ManualCpaH\x00\x12@\n\nmanual_cpc\x18\x18 \x01(\x0b\x32*.google.ads.googleads.v16.common.ManualCpcH\x00\x12@\n\nmanual_cpm\x18\x19 \x01(\x0b\x32*.google.ads.googleads.v16.common.ManualCpmH\x00\x12@\n\nmanual_cpv\x18% \x01(\x0b\x32*.google.ads.googleads.v16.common.ManualCpvH\x00\x12T\n\x14maximize_conversions\x18\x1e \x01(\x0b\x32\x34.google.ads.googleads.v16.common.MaximizeConversionsH\x00\x12]\n\x19maximize_conversion_value\x18\x1f \x01(\x0b\x32\x38.google.ads.googleads.v16.common.MaximizeConversionValueH\x00\x12@\n\ntarget_cpa\x18\x1a \x01(\x0b\x32*.google.ads.googleads.v16.common.TargetCpaH\x00\x12Y\n\x17target_impression_share\x18\x30 \x01(\x0b\x32\x36.google.ads.googleads.v16.common.TargetImpressionShareH\x00\x12\x42\n\x0btarget_roas\x18\x1d \x01(\x0b\x32+.google.ads.googleads.v16.common.TargetRoasH\x00\x12\x44\n\x0ctarget_spend\x18\x1b \x01(\x0b\x32,.google.ads.googleads.v16.common.TargetSpendH\x00\x12\x42\n\x0bpercent_cpc\x18\" \x01(\x0b\x32+.google.ads.googleads.v16.common.PercentCpcH\x00\x12@\n\ntarget_cpm\x18) \x01(\x0b\x32*.google.ads.googleads.v16.common.TargetCpmH\x00\x1a\x9f\x02\n\x15PerformanceMaxUpgrade\x12K\n\x18performance_max_campaign\x18\x01 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Campaign\x12G\n\x14pre_upgrade_campaign\x18\x02 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Campaign\x12p\n\x06status\x18\x03 \x01(\x0e\x32[.google.ads.googleads.v16.enums.PerformanceMaxUpgradeStatusEnum.PerformanceMaxUpgradeStatusB\x03\xe0\x41\x03\x1a\x8d\x03\n\x0fNetworkSettings\x12!\n\x14target_google_search\x18\x05 \x01(\x08H\x00\x88\x01\x01\x12\"\n\x15target_search_network\x18\x06 \x01(\x08H\x01\x88\x01\x01\x12#\n\x16target_content_network\x18\x07 \x01(\x08H\x02\x88\x01\x01\x12*\n\x1dtarget_partner_search_network\x18\x08 \x01(\x08H\x03\x88\x01\x01\x12\x1b\n\x0etarget_youtube\x18\t \x01(\x08H\x04\x88\x01\x01\x12%\n\x18target_google_tv_network\x18\n \x01(\x08H\x05\x88\x01\x01\x42\x17\n\x15_target_google_searchB\x18\n\x16_target_search_networkB\x19\n\x17_target_content_networkB \n\x1e_target_partner_search_networkB\x11\n\x0f_target_youtubeB\x1b\n\x19_target_google_tv_network\x1aI\n\x10HotelSettingInfo\x12!\n\x0fhotel_center_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x05H\x00\x88\x01\x01\x42\x12\n\x10_hotel_center_id\x1a\xc2\x01\n\x17\x44ynamicSearchAdsSetting\x12\x18\n\x0b\x64omain_name\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x07 \x01(\tB\x03\xe0\x41\x02\x12#\n\x16use_supplied_urls_only\x18\x08 \x01(\x08H\x00\x88\x01\x01\x12\x31\n\x05\x66\x65\x65\x64s\x18\t \x03(\tB\"\xfa\x41\x1f\n\x1dgoogleads.googleapis.com/FeedB\x19\n\x17_use_supplied_urls_only\x1a\xb7\x02\n\x0fShoppingSetting\x12\x18\n\x0bmerchant_id\x18\x05 \x01(\x03H\x00\x88\x01\x01\x12\x12\n\nfeed_label\x18\n \x01(\t\x12\x1e\n\x11\x63\x61mpaign_priority\x18\x07 \x01(\x05H\x01\x88\x01\x01\x12\x19\n\x0c\x65nable_local\x18\x08 \x01(\x08H\x02\x88\x01\x01\x12\"\n\x15use_vehicle_inventory\x18\t \x01(\x08\x42\x03\xe0\x41\x05\x12$\n\x17\x61\x64vertising_partner_ids\x18\x0b \x03(\x03\x42\x03\xe0\x41\x05\x12!\n\x14\x64isable_product_feed\x18\x0c \x01(\x08H\x03\x88\x01\x01\x42\x0e\n\x0c_merchant_idB\x14\n\x12_campaign_priorityB\x0f\n\r_enable_localB\x17\n\x15_disable_product_feed\x1a\x42\n\x0fTrackingSetting\x12\x1e\n\x0ctracking_url\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0f\n\r_tracking_url\x1a\xfc\x01\n\x14GeoTargetTypeSetting\x12q\n\x18positive_geo_target_type\x18\x01 \x01(\x0e\x32O.google.ads.googleads.v16.enums.PositiveGeoTargetTypeEnum.PositiveGeoTargetType\x12q\n\x18negative_geo_target_type\x18\x02 \x01(\x0e\x32O.google.ads.googleads.v16.enums.NegativeGeoTargetTypeEnum.NegativeGeoTargetType\x1a\x7f\n\x14LocalCampaignSetting\x12g\n\x14location_source_type\x18\x01 \x01(\x0e\x32I.google.ads.googleads.v16.enums.LocationSourceTypeEnum.LocationSourceType\x1a\xae\x02\n\x12\x41ppCampaignSetting\x12\x8d\x01\n\x1a\x62idding_strategy_goal_type\x18\x01 \x01(\x0e\x32i.google.ads.googleads.v16.enums.AppCampaignBiddingStrategyGoalTypeEnum.AppCampaignBiddingStrategyGoalType\x12\x18\n\x06\x61pp_id\x18\x04 \x01(\tB\x03\xe0\x41\x05H\x00\x88\x01\x01\x12\x63\n\tapp_store\x18\x03 \x01(\x0e\x32K.google.ads.googleads.v16.enums.AppCampaignAppStoreEnum.AppCampaignAppStoreB\x03\xe0\x41\x05\x42\t\n\x07_app_id\x1a\xf5\x01\n\x0cVanityPharma\x12\x81\x01\n\x1evanity_pharma_display_url_mode\x18\x01 \x01(\x0e\x32Y.google.ads.googleads.v16.enums.VanityPharmaDisplayUrlModeEnum.VanityPharmaDisplayUrlMode\x12\x61\n\x12vanity_pharma_text\x18\x02 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.VanityPharmaTextEnum.VanityPharmaText\x1a\x63\n\x15SelectiveOptimization\x12J\n\x12\x63onversion_actions\x18\x02 \x03(\tB.\xfa\x41+\n)googleads.googleapis.com/ConversionAction\x1a\x89\x01\n\x17OptimizationGoalSetting\x12n\n\x17optimization_goal_types\x18\x01 \x03(\x0e\x32M.google.ads.googleads.v16.enums.OptimizationGoalTypeEnum.OptimizationGoalType\x1aR\n\x0f\x41udienceSetting\x12&\n\x14use_audience_grouped\x18\x01 \x01(\x08\x42\x03\xe0\x41\x05H\x00\x88\x01\x01\x42\x17\n\x15_use_audience_grouped\x1ap\n\x1dLocalServicesCampaignSettings\x12O\n\rcategory_bids\x18\x01 \x03(\x0b\x32\x38.google.ads.googleads.v16.resources.Campaign.CategoryBid\x1au\n\x0b\x43\x61tegoryBid\x12\x18\n\x0b\x63\x61tegory_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\"\n\x15manual_cpa_bid_micros\x18\x02 \x01(\x03H\x01\x88\x01\x01\x42\x0e\n\x0c_category_idB\x18\n\x16_manual_cpa_bid_micros\x1aS\n\x16TravelCampaignSettings\x12#\n\x11travel_account_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x05H\x00\x88\x01\x01\x42\x14\n\x12_travel_account_id\x1aX\n\x19\x44iscoveryCampaignSettings\x12$\n\x12upgraded_targeting\x18\x01 \x01(\x08\x42\x03\xe0\x41\x05H\x00\x88\x01\x01\x42\x15\n\x13_upgraded_targeting\x1a\xb6\x02\n\x16\x41ssetAutomationSetting\x12o\n\x15\x61sset_automation_type\x18\x01 \x01(\x0e\x32K.google.ads.googleads.v16.enums.AssetAutomationTypeEnum.AssetAutomationTypeH\x00\x88\x01\x01\x12u\n\x17\x61sset_automation_status\x18\x02 \x01(\x0e\x32O.google.ads.googleads.v16.enums.AssetAutomationStatusEnum.AssetAutomationStatusH\x01\x88\x01\x01\x42\x18\n\x16_asset_automation_typeB\x1a\n\x18_asset_automation_status:W\xea\x41T\n!googleads.googleapis.com/Campaign\x12/customers/{customer_id}/campaigns/{campaign_id}B\x1b\n\x19\x63\x61mpaign_bidding_strategyB\x05\n\x03_idB\x07\n\x05_nameB\x18\n\x16_tracking_url_templateB\x13\n\x11_audience_settingB\x10\n\x0e_base_campaignB\x12\n\x10_campaign_budgetB\r\n\x0b_start_dateB\x11\n\x0f_campaign_groupB\x0b\n\t_end_dateB\x13\n\x11_final_url_suffixB\x15\n\x13_optimization_scoreB\x18\n\x16_url_expansion_opt_outB\x1b\n\x19_hotel_property_asset_setB\x0f\n\r_listing_typeB\xff\x01\n&com.google.ads.googleads.v16.resourcesB\rCampaignProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CustomParameter", "google/ads/googleads/v16/common/custom_parameter.proto"], + ["google.ads.googleads.v16.common.RealTimeBiddingSetting", "google/ads/googleads/v16/common/real_time_bidding_setting.proto"], + ["google.ads.googleads.v16.common.TargetingSetting", "google/ads/googleads/v16/common/targeting_setting.proto"], + ["google.ads.googleads.v16.common.FrequencyCapEntry", "google/ads/googleads/v16/common/frequency_cap.proto"], + ["google.ads.googleads.v16.common.Commission", "google/ads/googleads/v16/common/bidding.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + Campaign = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign").msgclass + Campaign::PerformanceMaxUpgrade = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.PerformanceMaxUpgrade").msgclass + Campaign::NetworkSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.NetworkSettings").msgclass + Campaign::HotelSettingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.HotelSettingInfo").msgclass + Campaign::DynamicSearchAdsSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.DynamicSearchAdsSetting").msgclass + Campaign::ShoppingSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.ShoppingSetting").msgclass + Campaign::TrackingSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.TrackingSetting").msgclass + Campaign::GeoTargetTypeSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.GeoTargetTypeSetting").msgclass + Campaign::LocalCampaignSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.LocalCampaignSetting").msgclass + Campaign::AppCampaignSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.AppCampaignSetting").msgclass + Campaign::VanityPharma = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.VanityPharma").msgclass + Campaign::SelectiveOptimization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.SelectiveOptimization").msgclass + Campaign::OptimizationGoalSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.OptimizationGoalSetting").msgclass + Campaign::AudienceSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.AudienceSetting").msgclass + Campaign::LocalServicesCampaignSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.LocalServicesCampaignSettings").msgclass + Campaign::CategoryBid = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.CategoryBid").msgclass + Campaign::TravelCampaignSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.TravelCampaignSettings").msgclass + Campaign::DiscoveryCampaignSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.DiscoveryCampaignSettings").msgclass + Campaign::AssetAutomationSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Campaign.AssetAutomationSetting").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/campaign_search_term_insight_pb.rb b/lib/google/ads/google_ads/v16/resources/campaign_search_term_insight_pb.rb new file mode 100644 index 000000000..7892fed1b --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/campaign_search_term_insight_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/campaign_search_term_insight.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/resources/campaign_search_term_insight.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf9\x02\n\x19\x43\x61mpaignSearchTermInsight\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xe0\x41\x03\xfa\x41\x34\n2googleads.googleapis.com/CampaignSearchTermInsight\x12 \n\x0e\x63\x61tegory_label\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x14\n\x02id\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1d\n\x0b\x63\x61mpaign_id\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01:\x87\x01\xea\x41\x83\x01\n2googleads.googleapis.com/CampaignSearchTermInsight\x12Mcustomers/{customer_id}/campaignSearchTermInsights/{campaign_id}~{cluster_id}B\x11\n\x0f_category_labelB\x05\n\x03_idB\x0e\n\x0c_campaign_idB\x90\x02\n&com.google.ads.googleads.v16.resourcesB\x1e\x43\x61mpaignSearchTermInsightProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CampaignSearchTermInsight = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CampaignSearchTermInsight").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/campaign_shared_set_pb.rb b/lib/google/ads/google_ads/v16/resources/campaign_shared_set_pb.rb new file mode 100644 index 000000000..19a273af1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/campaign_shared_set_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/campaign_shared_set.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/campaign_shared_set_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n.google.ads.googleads.v16.common.TargetRoasSimulationPointListB\x03\xe0\x41\x03H\x00\x12|\n\"target_impression_share_point_list\x18\n \x01(\x0b\x32I.google.ads.googleads.v16.common.TargetImpressionShareSimulationPointListB\x03\xe0\x41\x03H\x00\x12\\\n\x11\x62udget_point_list\x18\x0b \x01(\x0b\x32:.google.ads.googleads.v16.common.BudgetSimulationPointListB\x03\xe0\x41\x03H\x00:\xa1\x01\xea\x41\x9d\x01\n+googleads.googleapis.com/CampaignSimulation\x12ncustomers/{customer_id}/campaignSimulations/{campaign_id}~{type}~{modification_method}~{start_date}~{end_date}B\x0c\n\npoint_listB\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17\x43\x61mpaignSimulationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CpcBidSimulationPointList", "google/ads/googleads/v16/common/simulation.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CampaignSimulation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CampaignSimulation").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/carrier_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/carrier_constant_pb.rb new file mode 100644 index 000000000..ad013d3e5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/carrier_constant_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/carrier_constant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/resources/carrier_constant.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x99\x02\n\x0f\x43\x61rrierConstant\x12G\n\rresource_name\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(googleads.googleapis.com/CarrierConstant\x12\x14\n\x02id\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x16\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1e\n\x0c\x63ountry_code\x18\x07 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01:N\xea\x41K\n(googleads.googleapis.com/CarrierConstant\x12\x1f\x63\x61rrierConstants/{criterion_id}B\x05\n\x03_idB\x07\n\x05_nameB\x0f\n\r_country_codeB\x86\x02\n&com.google.ads.googleads.v16.resourcesB\x14\x43\x61rrierConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CarrierConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CarrierConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/change_event_pb.rb b/lib/google/ads/google_ads/v16/resources/change_event_pb.rb new file mode 100644 index 000000000..54100aa6a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/change_event_pb.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/change_event.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/change_client_type_pb' +require 'google/ads/google_ads/v16/enums/change_event_resource_type_pb' +require 'google/ads/google_ads/v16/enums/resource_change_operation_pb' +require 'google/ads/google_ads/v16/resources/ad_pb' +require 'google/ads/google_ads/v16/resources/ad_group_pb' +require 'google/ads/google_ads/v16/resources/ad_group_ad_pb' +require 'google/ads/google_ads/v16/resources/ad_group_asset_pb' +require 'google/ads/google_ads/v16/resources/ad_group_bid_modifier_pb' +require 'google/ads/google_ads/v16/resources/ad_group_criterion_pb' +require 'google/ads/google_ads/v16/resources/ad_group_feed_pb' +require 'google/ads/google_ads/v16/resources/asset_pb' +require 'google/ads/google_ads/v16/resources/asset_set_pb' +require 'google/ads/google_ads/v16/resources/asset_set_asset_pb' +require 'google/ads/google_ads/v16/resources/campaign_pb' +require 'google/ads/google_ads/v16/resources/campaign_asset_pb' +require 'google/ads/google_ads/v16/resources/campaign_asset_set_pb' +require 'google/ads/google_ads/v16/resources/campaign_budget_pb' +require 'google/ads/google_ads/v16/resources/campaign_criterion_pb' +require 'google/ads/google_ads/v16/resources/campaign_feed_pb' +require 'google/ads/google_ads/v16/resources/customer_asset_pb' +require 'google/ads/google_ads/v16/resources/feed_pb' +require 'google/ads/google_ads/v16/resources/feed_item_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n5google/ads/googleads/v16/resources/change_event.proto\x12\"google.ads.googleads.v16.resources\x1a\x37google/ads/googleads/v16/enums/change_client_type.proto\x1a?google/ads/googleads/v16/enums/change_event_resource_type.proto\x1a>google/ads/googleads/v16/enums/resource_change_operation.proto\x1a+google/ads/googleads/v16/resources/ad.proto\x1a\x31google/ads/googleads/v16/resources/ad_group.proto\x1a\x34google/ads/googleads/v16/resources/ad_group_ad.proto\x1a\x37google/ads/googleads/v16/resources/ad_group_asset.proto\x1a>google/ads/googleads/v16/resources/ad_group_bid_modifier.proto\x1a;google/ads/googleads/v16/resources/ad_group_criterion.proto\x1a\x36google/ads/googleads/v16/resources/ad_group_feed.proto\x1a.google/ads/googleads/v16/resources/asset.proto\x1a\x32google/ads/googleads/v16/resources/asset_set.proto\x1a\x38google/ads/googleads/v16/resources/asset_set_asset.proto\x1a\x31google/ads/googleads/v16/resources/campaign.proto\x1a\x37google/ads/googleads/v16/resources/campaign_asset.proto\x1a;google/ads/googleads/v16/resources/campaign_asset_set.proto\x1a\x38google/ads/googleads/v16/resources/campaign_budget.proto\x1a;google/ads/googleads/v16/resources/campaign_criterion.proto\x1a\x36google/ads/googleads/v16/resources/campaign_feed.proto\x1a\x37google/ads/googleads/v16/resources/customer_asset.proto\x1a-google/ads/googleads/v16/resources/feed.proto\x1a\x32google/ads/googleads/v16/resources/feed_item.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xd1\x14\n\x0b\x43hangeEvent\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xe0\x41\x03\xfa\x41&\n$googleads.googleapis.com/ChangeEvent\x12\x1d\n\x10\x63hange_date_time\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12v\n\x14\x63hange_resource_type\x18\x03 \x01(\x0e\x32S.google.ads.googleads.v16.enums.ChangeEventResourceTypeEnum.ChangeEventResourceTypeB\x03\xe0\x41\x03\x12!\n\x14\x63hange_resource_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12_\n\x0b\x63lient_type\x18\x05 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.ChangeClientTypeEnum.ChangeClientTypeB\x03\xe0\x41\x03\x12\x17\n\nuser_email\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x0cold_resource\x18\x07 \x01(\x0b\x32?.google.ads.googleads.v16.resources.ChangeEvent.ChangedResourceB\x03\xe0\x41\x03\x12Z\n\x0cnew_resource\x18\x08 \x01(\x0b\x32?.google.ads.googleads.v16.resources.ChangeEvent.ChangedResourceB\x03\xe0\x41\x03\x12{\n\x19resource_change_operation\x18\t \x01(\x0e\x32S.google.ads.googleads.v16.enums.ResourceChangeOperationEnum.ResourceChangeOperationB\x03\xe0\x41\x03\x12\x37\n\x0e\x63hanged_fields\x18\n \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x03\x12;\n\x08\x63\x61mpaign\x18\x0b \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Campaign\x12:\n\x08\x61\x64_group\x18\x0c \x01(\tB(\xe0\x41\x03\xfa\x41\"\n googleads.googleapis.com/AdGroup\x12\x33\n\x04\x66\x65\x65\x64\x18\r \x01(\tB%\xe0\x41\x03\xfa\x41\x1f\n\x1dgoogleads.googleapis.com/Feed\x12<\n\tfeed_item\x18\x0e \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/FeedItem\x12\x35\n\x05\x61sset\x18\x14 \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1egoogleads.googleapis.com/Asset\x1a\xb3\x0b\n\x0f\x43hangedResource\x12\x37\n\x02\x61\x64\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdB\x03\xe0\x41\x03\x12\x42\n\x08\x61\x64_group\x18\x02 \x01(\x0b\x32+.google.ads.googleads.v16.resources.AdGroupB\x03\xe0\x41\x03\x12U\n\x12\x61\x64_group_criterion\x18\x03 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.AdGroupCriterionB\x03\xe0\x41\x03\x12\x43\n\x08\x63\x61mpaign\x18\x04 \x01(\x0b\x32,.google.ads.googleads.v16.resources.CampaignB\x03\xe0\x41\x03\x12P\n\x0f\x63\x61mpaign_budget\x18\x05 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CampaignBudgetB\x03\xe0\x41\x03\x12Z\n\x15\x61\x64_group_bid_modifier\x18\x06 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.AdGroupBidModifierB\x03\xe0\x41\x03\x12V\n\x12\x63\x61mpaign_criterion\x18\x07 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.CampaignCriterionB\x03\xe0\x41\x03\x12;\n\x04\x66\x65\x65\x64\x18\x08 \x01(\x0b\x32(.google.ads.googleads.v16.resources.FeedB\x03\xe0\x41\x03\x12\x44\n\tfeed_item\x18\t \x01(\x0b\x32,.google.ads.googleads.v16.resources.FeedItemB\x03\xe0\x41\x03\x12L\n\rcampaign_feed\x18\n \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CampaignFeedB\x03\xe0\x41\x03\x12K\n\rad_group_feed\x18\x0b \x01(\x0b\x32/.google.ads.googleads.v16.resources.AdGroupFeedB\x03\xe0\x41\x03\x12G\n\x0b\x61\x64_group_ad\x18\x0c \x01(\x0b\x32-.google.ads.googleads.v16.resources.AdGroupAdB\x03\xe0\x41\x03\x12=\n\x05\x61sset\x18\r \x01(\x0b\x32).google.ads.googleads.v16.resources.AssetB\x03\xe0\x41\x03\x12N\n\x0e\x63ustomer_asset\x18\x0e \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CustomerAssetB\x03\xe0\x41\x03\x12N\n\x0e\x63\x61mpaign_asset\x18\x0f \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignAssetB\x03\xe0\x41\x03\x12M\n\x0e\x61\x64_group_asset\x18\x10 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.AdGroupAssetB\x03\xe0\x41\x03\x12\x44\n\tasset_set\x18\x11 \x01(\x0b\x32,.google.ads.googleads.v16.resources.AssetSetB\x03\xe0\x41\x03\x12O\n\x0f\x61sset_set_asset\x18\x12 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.AssetSetAssetB\x03\xe0\x41\x03\x12U\n\x12\x63\x61mpaign_asset_set\x18\x13 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CampaignAssetSetB\x03\xe0\x41\x03:\x81\x01\xea\x41~\n$googleads.googleapis.com/ChangeEvent\x12Vcustomers/{customer_id}/changeEvents/{timestamp_micros}~{command_index}~{mutate_index}B\x82\x02\n&com.google.ads.googleads.v16.resourcesB\x10\x43hangeEventProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.Ad", "google/ads/googleads/v16/resources/ad.proto"], + ["google.ads.googleads.v16.resources.AdGroup", "google/ads/googleads/v16/resources/ad_group.proto"], + ["google.ads.googleads.v16.resources.AdGroupCriterion", "google/ads/googleads/v16/resources/ad_group_criterion.proto"], + ["google.ads.googleads.v16.resources.Campaign", "google/ads/googleads/v16/resources/campaign.proto"], + ["google.ads.googleads.v16.resources.CampaignBudget", "google/ads/googleads/v16/resources/campaign_budget.proto"], + ["google.ads.googleads.v16.resources.AdGroupBidModifier", "google/ads/googleads/v16/resources/ad_group_bid_modifier.proto"], + ["google.ads.googleads.v16.resources.CampaignCriterion", "google/ads/googleads/v16/resources/campaign_criterion.proto"], + ["google.ads.googleads.v16.resources.Feed", "google/ads/googleads/v16/resources/feed.proto"], + ["google.ads.googleads.v16.resources.FeedItem", "google/ads/googleads/v16/resources/feed_item.proto"], + ["google.ads.googleads.v16.resources.CampaignFeed", "google/ads/googleads/v16/resources/campaign_feed.proto"], + ["google.ads.googleads.v16.resources.AdGroupFeed", "google/ads/googleads/v16/resources/ad_group_feed.proto"], + ["google.ads.googleads.v16.resources.AdGroupAd", "google/ads/googleads/v16/resources/ad_group_ad.proto"], + ["google.ads.googleads.v16.resources.Asset", "google/ads/googleads/v16/resources/asset.proto"], + ["google.ads.googleads.v16.resources.CustomerAsset", "google/ads/googleads/v16/resources/customer_asset.proto"], + ["google.ads.googleads.v16.resources.CampaignAsset", "google/ads/googleads/v16/resources/campaign_asset.proto"], + ["google.ads.googleads.v16.resources.AdGroupAsset", "google/ads/googleads/v16/resources/ad_group_asset.proto"], + ["google.ads.googleads.v16.resources.AssetSet", "google/ads/googleads/v16/resources/asset_set.proto"], + ["google.ads.googleads.v16.resources.AssetSetAsset", "google/ads/googleads/v16/resources/asset_set_asset.proto"], + ["google.ads.googleads.v16.resources.CampaignAssetSet", "google/ads/googleads/v16/resources/campaign_asset_set.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ChangeEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ChangeEvent").msgclass + ChangeEvent::ChangedResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ChangeEvent.ChangedResource").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/change_status_pb.rb b/lib/google/ads/google_ads/v16/resources/change_status_pb.rb new file mode 100644 index 000000000..0890b6460 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/change_status_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/change_status.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/change_status_operation_pb' +require 'google/ads/google_ads/v16/enums/change_status_resource_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n6google/ads/googleads/v16/resources/change_status.proto\x12\"google.ads.googleads.v16.resources\x1a\n\nshared_set\x18! \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"googleads.googleapis.com/SharedSet\x12O\n\x13\x63\x61mpaign_shared_set\x18\" \x01(\tB2\xe0\x41\x03\xfa\x41,\n*googleads.googleapis.com/CampaignSharedSet\x12\x35\n\x05\x61sset\x18# \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1egoogleads.googleapis.com/Asset\x12\x46\n\x0e\x63ustomer_asset\x18$ \x01(\tB.\xe0\x41\x03\xfa\x41(\n&googleads.googleapis.com/CustomerAsset\x12\x46\n\x0e\x63\x61mpaign_asset\x18% \x01(\tB.\xe0\x41\x03\xfa\x41(\n&googleads.googleapis.com/CampaignAsset\x12\x45\n\x0e\x61\x64_group_asset\x18& \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%googleads.googleapis.com/AdGroupAsset\x12L\n\x11\x63ombined_audience\x18( \x01(\tB1\xe0\x41\x03\xfa\x41+\n)googleads.googleapis.com/CombinedAudience:c\xea\x41`\n%googleads.googleapis.com/ChangeStatus\x12\x37\x63ustomers/{customer_id}/changeStatus/{change_status_id}B\x18\n\x16_last_change_date_timeB\x0b\n\t_campaignB\x0b\n\t_ad_groupB\x0e\n\x0c_ad_group_adB\x15\n\x13_ad_group_criterionB\x15\n\x13_campaign_criterionB\x07\n\x05_feedB\x0c\n\n_feed_itemB\x10\n\x0e_ad_group_feedB\x10\n\x0e_campaign_feedB\x18\n\x16_ad_group_bid_modifierB\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11\x43hangeStatusProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ChangeStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ChangeStatus").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/click_view_pb.rb b/lib/google/ads/google_ads/v16/resources/click_view_pb.rb new file mode 100644 index 000000000..72883348e --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/click_view_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/click_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/click_location_pb' +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/ads/googleads/v16/resources/click_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x34google/ads/googleads/v16/common/click_location.proto\x1a.google/ads/googleads/v16/common/criteria.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xca\x06\n\tClickView\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"googleads.googleapis.com/ClickView\x12\x17\n\x05gclid\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12M\n\x10\x61rea_of_interest\x18\x03 \x01(\x0b\x32..google.ads.googleads.v16.common.ClickLocationB\x03\xe0\x41\x03\x12Q\n\x14location_of_presence\x18\x04 \x01(\x0b\x32..google.ads.googleads.v16.common.ClickLocationB\x03\xe0\x41\x03\x12\x1d\n\x0bpage_number\x18\t \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x44\n\x0b\x61\x64_group_ad\x18\n \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"googleads.googleapis.com/AdGroupAdH\x02\x88\x01\x01\x12Y\n\x18\x63\x61mpaign_location_target\x18\x0b \x01(\tB2\xe0\x41\x03\xfa\x41,\n*googleads.googleapis.com/GeoTargetConstantH\x03\x88\x01\x01\x12\x41\n\tuser_list\x18\x0c \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/UserListH\x04\x88\x01\x01\x12\x42\n\x07keyword\x18\r \x01(\tB1\xe0\x41\x03\xfa\x41+\n)googleads.googleapis.com/AdGroupCriterion\x12G\n\x0ckeyword_info\x18\x0e \x01(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x03:Z\xea\x41W\n\"googleads.googleapis.com/ClickView\x12\x31\x63ustomers/{customer_id}/clickViews/{date}~{gclid}B\x08\n\x06_gclidB\x0e\n\x0c_page_numberB\x0e\n\x0c_ad_group_adB\x1b\n\x19_campaign_location_targetB\x0c\n\n_user_listB\x80\x02\n&com.google.ads.googleads.v16.resourcesB\x0e\x43lickViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.ClickLocation", "google/ads/googleads/v16/common/click_location.proto"], + ["google.ads.googleads.v16.common.KeywordInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ClickView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ClickView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/combined_audience_pb.rb b/lib/google/ads/google_ads/v16/resources/combined_audience_pb.rb new file mode 100644 index 000000000..95d68a501 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/combined_audience_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/combined_audience.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/combined_audience_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/resources/combined_audience.proto\x12\"google.ads.googleads.v16.resources\x1a=google/ads/googleads/v16/enums/combined_audience_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf4\x02\n\x10\x43ombinedAudience\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x05\xfa\x41+\n)googleads.googleapis.com/CombinedAudience\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x66\n\x06status\x18\x03 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.CombinedAudienceStatusEnum.CombinedAudienceStatusB\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x03:p\xea\x41m\n)googleads.googleapis.com/CombinedAudience\x12@customers/{customer_id}/combinedAudiences/{combined_audience_id}B\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15\x43ombinedAudienceProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CombinedAudience = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CombinedAudience").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/conversion_action_pb.rb b/lib/google/ads/google_ads/v16/resources/conversion_action_pb.rb new file mode 100644 index 000000000..06a5acb12 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/conversion_action_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/conversion_action.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/tag_snippet_pb' +require 'google/ads/google_ads/v16/enums/attribution_model_pb' +require 'google/ads/google_ads/v16/enums/conversion_action_category_pb' +require 'google/ads/google_ads/v16/enums/conversion_action_counting_type_pb' +require 'google/ads/google_ads/v16/enums/conversion_action_status_pb' +require 'google/ads/google_ads/v16/enums/conversion_action_type_pb' +require 'google/ads/google_ads/v16/enums/conversion_origin_pb' +require 'google/ads/google_ads/v16/enums/data_driven_model_status_pb' +require 'google/ads/google_ads/v16/enums/mobile_app_vendor_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/resources/conversion_action.proto\x12\"google.ads.googleads.v16.resources\x1a\x31google/ads/googleads/v16/common/tag_snippet.proto\x1a\x36google/ads/googleads/v16/enums/attribution_model.proto\x1a?google/ads/googleads/v16/enums/conversion_action_category.proto\x1a\x44google/ads/googleads/v16/enums/conversion_action_counting_type.proto\x1a=google/ads/googleads/v16/enums/conversion_action_status.proto\x1a;google/ads/googleads/v16/enums/conversion_action_type.proto\x1a\x36google/ads/googleads/v16/enums/conversion_origin.proto\x1a=google/ads/googleads/v16/enums/data_driven_model_status.proto\x1a\x36google/ads/googleads/v16/enums/mobile_app_vendor.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x93\x16\n\x10\x43onversionAction\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x05\xfa\x41+\n)googleads.googleapis.com/ConversionAction\x12\x14\n\x02id\x18\x15 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x11\n\x04name\x18\x16 \x01(\tH\x01\x88\x01\x01\x12\x61\n\x06status\x18\x04 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.ConversionActionStatusEnum.ConversionActionStatus\x12`\n\x04type\x18\x05 \x01(\x0e\x32M.google.ads.googleads.v16.enums.ConversionActionTypeEnum.ConversionActionTypeB\x03\xe0\x41\x05\x12Z\n\x06origin\x18\x1e \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.ConversionOriginEnum.ConversionOriginB\x03\xe0\x41\x03\x12\x1d\n\x10primary_for_goal\x18\x1f \x01(\x08H\x02\x88\x01\x01\x12g\n\x08\x63\x61tegory\x18\x06 \x01(\x0e\x32U.google.ads.googleads.v16.enums.ConversionActionCategoryEnum.ConversionActionCategory\x12\x46\n\x0eowner_customer\x18\x17 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/CustomerH\x03\x88\x01\x01\x12*\n\x1dinclude_in_conversions_metric\x18\x18 \x01(\x08H\x04\x88\x01\x01\x12/\n\"click_through_lookback_window_days\x18\x19 \x01(\x03H\x05\x88\x01\x01\x12.\n!view_through_lookback_window_days\x18\x1a \x01(\x03H\x06\x88\x01\x01\x12Z\n\x0evalue_settings\x18\x0b \x01(\x0b\x32\x42.google.ads.googleads.v16.resources.ConversionAction.ValueSettings\x12t\n\rcounting_type\x18\x0c \x01(\x0e\x32].google.ads.googleads.v16.enums.ConversionActionCountingTypeEnum.ConversionActionCountingType\x12q\n\x1a\x61ttribution_model_settings\x18\r \x01(\x0b\x32M.google.ads.googleads.v16.resources.ConversionAction.AttributionModelSettings\x12\x46\n\x0ctag_snippets\x18\x0e \x03(\x0b\x32+.google.ads.googleads.v16.common.TagSnippetB\x03\xe0\x41\x03\x12(\n\x1bphone_call_duration_seconds\x18\x1b \x01(\x03H\x07\x88\x01\x01\x12\x13\n\x06\x61pp_id\x18\x1c \x01(\tH\x08\x88\x01\x01\x12\x63\n\x11mobile_app_vendor\x18\x11 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.MobileAppVendorEnum.MobileAppVendorB\x03\xe0\x41\x03\x12\x65\n\x11\x66irebase_settings\x18\x12 \x01(\x0b\x32\x45.google.ads.googleads.v16.resources.ConversionAction.FirebaseSettingsB\x03\xe0\x41\x03\x12\x84\x01\n\"third_party_app_analytics_settings\x18\x13 \x01(\x0b\x32S.google.ads.googleads.v16.resources.ConversionAction.ThirdPartyAppAnalyticsSettingsB\x03\xe0\x41\x03\x12w\n\x1bgoogle_analytics_4_settings\x18\" \x01(\x0b\x32M.google.ads.googleads.v16.resources.ConversionAction.GoogleAnalytics4SettingsB\x03\xe0\x41\x03\x1a\xf4\x01\n\x18\x41ttributionModelSettings\x12`\n\x11\x61ttribution_model\x18\x01 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.AttributionModelEnum.AttributionModel\x12v\n\x18\x64\x61ta_driven_model_status\x18\x02 \x01(\x0e\x32O.google.ads.googleads.v16.enums.DataDrivenModelStatusEnum.DataDrivenModelStatusB\x03\xe0\x41\x03\x1a\xbf\x01\n\rValueSettings\x12\x1a\n\rdefault_value\x18\x04 \x01(\x01H\x00\x88\x01\x01\x12\"\n\x15\x64\x65\x66\x61ult_currency_code\x18\x05 \x01(\tH\x01\x88\x01\x01\x12%\n\x18\x61lways_use_default_value\x18\x06 \x01(\x08H\x02\x88\x01\x01\x42\x10\n\x0e_default_valueB\x18\n\x16_default_currency_codeB\x1b\n\x19_always_use_default_value\x1ai\n\x1eThirdPartyAppAnalyticsSettings\x12\x1c\n\nevent_name\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1a\n\rprovider_name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x42\r\n\x0b_event_name\x1a\xa2\x01\n\x10\x46irebaseSettings\x12\x1c\n\nevent_name\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1c\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x18\n\x0bproperty_id\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1a\n\rproperty_name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x42\r\n\x0b_event_nameB\r\n\x0b_project_id\x1ai\n\x18GoogleAnalytics4Settings\x12\x17\n\nevent_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rproperty_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bproperty_id\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03:p\xea\x41m\n)googleads.googleapis.com/ConversionAction\x12@customers/{customer_id}/conversionActions/{conversion_action_id}B\x05\n\x03_idB\x07\n\x05_nameB\x13\n\x11_primary_for_goalB\x11\n\x0f_owner_customerB \n\x1e_include_in_conversions_metricB%\n#_click_through_lookback_window_daysB$\n\"_view_through_lookback_window_daysB\x1e\n\x1c_phone_call_duration_secondsB\t\n\x07_app_idB\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15\x43onversionActionProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.TagSnippet", "google/ads/googleads/v16/common/tag_snippet.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ConversionAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionAction").msgclass + ConversionAction::AttributionModelSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionAction.AttributionModelSettings").msgclass + ConversionAction::ValueSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionAction.ValueSettings").msgclass + ConversionAction::ThirdPartyAppAnalyticsSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionAction.ThirdPartyAppAnalyticsSettings").msgclass + ConversionAction::FirebaseSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionAction.FirebaseSettings").msgclass + ConversionAction::GoogleAnalytics4Settings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionAction.GoogleAnalytics4Settings").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/conversion_custom_variable_pb.rb b/lib/google/ads/google_ads/v16/resources/conversion_custom_variable_pb.rb new file mode 100644 index 000000000..b15248c42 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/conversion_custom_variable_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/conversion_custom_variable.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/conversion_custom_variable_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/resources/conversion_custom_variable.proto\x12\"google.ads.googleads.v16.resources\x1a\x46google/ads/googleads/v16/enums/conversion_custom_variable_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe8\x03\n\x18\x43onversionCustomVariable\x12P\n\rresource_name\x18\x01 \x01(\tB9\xe0\x41\x05\xfa\x41\x33\n1googleads.googleapis.com/ConversionCustomVariable\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x03tag\x18\x04 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12q\n\x06status\x18\x05 \x01(\x0e\x32\x61.google.ads.googleads.v16.enums.ConversionCustomVariableStatusEnum.ConversionCustomVariableStatus\x12\x41\n\x0eowner_customer\x18\x06 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Customer:\x8a\x01\xea\x41\x86\x01\n1googleads.googleapis.com/ConversionCustomVariable\x12Qcustomers/{customer_id}/conversionCustomVariables/{conversion_custom_variable_id}B\x8f\x02\n&com.google.ads.googleads.v16.resourcesB\x1d\x43onversionCustomVariableProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ConversionCustomVariable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionCustomVariable").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/conversion_goal_campaign_config_pb.rb b/lib/google/ads/google_ads/v16/resources/conversion_goal_campaign_config_pb.rb new file mode 100644 index 000000000..c2073ff90 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/conversion_goal_campaign_config_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/conversion_goal_campaign_config.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/goal_config_level_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nHgoogle/ads/googleads/v16/resources/conversion_goal_campaign_config.proto\x12\"google.ads.googleads.v16.resources\x1a\x36google/ads/googleads/v16/enums/goal_config_level.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe6\x03\n\x1c\x43onversionGoalCampaignConfig\x12T\n\rresource_name\x18\x01 \x01(\tB=\xe0\x41\x05\xfa\x41\x37\n5googleads.googleapis.com/ConversionGoalCampaignConfig\x12;\n\x08\x63\x61mpaign\x18\x02 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/Campaign\x12^\n\x11goal_config_level\x18\x03 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.GoalConfigLevelEnum.GoalConfigLevel\x12R\n\x16\x63ustom_conversion_goal\x18\x04 \x01(\tB2\xfa\x41/\n-googleads.googleapis.com/CustomConversionGoal:\x7f\xea\x41|\n5googleads.googleapis.com/ConversionGoalCampaignConfig\x12\x43\x63ustomers/{customer_id}/conversionGoalCampaignConfigs/{campaign_id}B\x93\x02\n&com.google.ads.googleads.v16.resourcesB!ConversionGoalCampaignConfigProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ConversionGoalCampaignConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionGoalCampaignConfig").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/conversion_value_rule_pb.rb b/lib/google/ads/google_ads/v16/resources/conversion_value_rule_pb.rb new file mode 100644 index 000000000..e0888cad3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/conversion_value_rule_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/conversion_value_rule.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/conversion_value_rule_status_pb' +require 'google/ads/google_ads/v16/enums/value_rule_device_type_pb' +require 'google/ads/google_ads/v16/enums/value_rule_geo_location_match_type_pb' +require 'google/ads/google_ads/v16/enums/value_rule_operation_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/resources/conversion_value_rule.proto\x12\"google.ads.googleads.v16.resources\x1a\x41google/ads/googleads/v16/enums/conversion_value_rule_status.proto\x1a;google/ads/googleads/v16/enums/value_rule_device_type.proto\x1aGgoogle/ads/googleads/v16/enums/value_rule_geo_location_match_type.proto\x1a\x39google/ads/googleads/v16/enums/value_rule_operation.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xaa\r\n\x13\x43onversionValueRule\x12K\n\rresource_name\x18\x01 \x01(\tB4\xe0\x41\x05\xfa\x41.\n,googleads.googleapis.com/ConversionValueRule\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12W\n\x06\x61\x63tion\x18\x03 \x01(\x0b\x32G.google.ads.googleads.v16.resources.ConversionValueRule.ValueRuleAction\x12u\n\x16geo_location_condition\x18\x04 \x01(\x0b\x32U.google.ads.googleads.v16.resources.ConversionValueRule.ValueRuleGeoLocationCondition\x12j\n\x10\x64\x65vice_condition\x18\x05 \x01(\x0b\x32P.google.ads.googleads.v16.resources.ConversionValueRule.ValueRuleDeviceCondition\x12n\n\x12\x61udience_condition\x18\x06 \x01(\x0b\x32R.google.ads.googleads.v16.resources.ConversionValueRule.ValueRuleAudienceCondition\x12\x41\n\x0eowner_customer\x18\x07 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Customer\x12g\n\x06status\x18\x08 \x01(\x0e\x32W.google.ads.googleads.v16.enums.ConversionValueRuleStatusEnum.ConversionValueRuleStatus\x1a~\n\x0fValueRuleAction\x12\\\n\toperation\x18\x01 \x01(\x0e\x32I.google.ads.googleads.v16.enums.ValueRuleOperationEnum.ValueRuleOperation\x12\r\n\x05value\x18\x02 \x01(\x01\x1a\xc2\x03\n\x1dValueRuleGeoLocationCondition\x12V\n\x1d\x65xcluded_geo_target_constants\x18\x01 \x03(\tB/\xfa\x41,\n*googleads.googleapis.com/GeoTargetConstant\x12\x80\x01\n\x17\x65xcluded_geo_match_type\x18\x02 \x01(\x0e\x32_.google.ads.googleads.v16.enums.ValueRuleGeoLocationMatchTypeEnum.ValueRuleGeoLocationMatchType\x12M\n\x14geo_target_constants\x18\x03 \x03(\tB/\xfa\x41,\n*googleads.googleapis.com/GeoTargetConstant\x12w\n\x0egeo_match_type\x18\x04 \x01(\x0e\x32_.google.ads.googleads.v16.enums.ValueRuleGeoLocationMatchTypeEnum.ValueRuleGeoLocationMatchType\x1a}\n\x18ValueRuleDeviceCondition\x12\x61\n\x0c\x64\x65vice_types\x18\x01 \x03(\x0e\x32K.google.ads.googleads.v16.enums.ValueRuleDeviceTypeEnum.ValueRuleDeviceType\x1a\x9c\x01\n\x1aValueRuleAudienceCondition\x12:\n\nuser_lists\x18\x01 \x03(\tB&\xfa\x41#\n!googleads.googleapis.com/UserList\x12\x42\n\x0euser_interests\x18\x02 \x03(\tB*\xfa\x41\'\n%googleads.googleapis.com/UserInterest:z\xea\x41w\n,googleads.googleapis.com/ConversionValueRule\x12Gcustomers/{customer_id}/conversionValueRules/{conversion_value_rule_id}B\x8a\x02\n&com.google.ads.googleads.v16.resourcesB\x18\x43onversionValueRuleProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ConversionValueRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionValueRule").msgclass + ConversionValueRule::ValueRuleAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionValueRule.ValueRuleAction").msgclass + ConversionValueRule::ValueRuleGeoLocationCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionValueRule.ValueRuleGeoLocationCondition").msgclass + ConversionValueRule::ValueRuleDeviceCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionValueRule.ValueRuleDeviceCondition").msgclass + ConversionValueRule::ValueRuleAudienceCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionValueRule.ValueRuleAudienceCondition").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/conversion_value_rule_set_pb.rb b/lib/google/ads/google_ads/v16/resources/conversion_value_rule_set_pb.rb new file mode 100644 index 000000000..55ade8049 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/conversion_value_rule_set_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/conversion_value_rule_set.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/conversion_action_category_pb' +require 'google/ads/google_ads/v16/enums/conversion_value_rule_set_status_pb' +require 'google/ads/google_ads/v16/enums/value_rule_set_attachment_type_pb' +require 'google/ads/google_ads/v16/enums/value_rule_set_dimension_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/resources/conversion_value_rule_set.proto\x12\"google.ads.googleads.v16.resources\x1a?google/ads/googleads/v16/enums/conversion_action_category.proto\x1a\x45google/ads/googleads/v16/enums/conversion_value_rule_set_status.proto\x1a\x43google/ads/googleads/v16/enums/value_rule_set_attachment_type.proto\x1a=google/ads/googleads/v16/enums/value_rule_set_dimension.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa6\x07\n\x16\x43onversionValueRuleSet\x12N\n\rresource_name\x18\x01 \x01(\tB7\xe0\x41\x05\xfa\x41\x31\n/googleads.googleapis.com/ConversionValueRuleSet\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12Q\n\x16\x63onversion_value_rules\x18\x03 \x03(\tB1\xfa\x41.\n,googleads.googleapis.com/ConversionValueRule\x12\x63\n\ndimensions\x18\x04 \x03(\x0e\x32O.google.ads.googleads.v16.enums.ValueRuleSetDimensionEnum.ValueRuleSetDimension\x12\x41\n\x0eowner_customer\x18\x05 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Customer\x12w\n\x0f\x61ttachment_type\x18\x06 \x01(\x0e\x32Y.google.ads.googleads.v16.enums.ValueRuleSetAttachmentTypeEnum.ValueRuleSetAttachmentTypeB\x03\xe0\x41\x05\x12\x38\n\x08\x63\x61mpaign\x18\x07 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/Campaign\x12r\n\x06status\x18\x08 \x01(\x0e\x32].google.ads.googleads.v16.enums.ConversionValueRuleSetStatusEnum.ConversionValueRuleSetStatusB\x03\xe0\x41\x03\x12\x80\x01\n\x1c\x63onversion_action_categories\x18\t \x03(\x0e\x32U.google.ads.googleads.v16.enums.ConversionActionCategoryEnum.ConversionActionCategoryB\x03\xe0\x41\x05:\x85\x01\xea\x41\x81\x01\n/googleads.googleapis.com/ConversionValueRuleSet\x12Ncustomers/{customer_id}/conversionValueRuleSets/{conversion_value_rule_set_id}B\x8d\x02\n&com.google.ads.googleads.v16.resourcesB\x1b\x43onversionValueRuleSetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ConversionValueRuleSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionValueRuleSet").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/currency_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/currency_constant_pb.rb new file mode 100644 index 000000000..d42adaddf --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/currency_constant_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/currency_constant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/resources/currency_constant.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xce\x02\n\x10\x43urrencyConstant\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x03\xfa\x41+\n)googleads.googleapis.com/CurrencyConstant\x12\x16\n\x04\x63ode\x18\x06 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x16\n\x04name\x18\x07 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x18\n\x06symbol\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12&\n\x14\x62illable_unit_micros\x18\t \x01(\x03\x42\x03\xe0\x41\x03H\x03\x88\x01\x01:H\xea\x41\x45\n)googleads.googleapis.com/CurrencyConstant\x12\x18\x63urrencyConstants/{code}B\x07\n\x05_codeB\x07\n\x05_nameB\t\n\x07_symbolB\x17\n\x15_billable_unit_microsB\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15\x43urrencyConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CurrencyConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CurrencyConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/custom_audience_pb.rb b/lib/google/ads/google_ads/v16/resources/custom_audience_pb.rb new file mode 100644 index 000000000..659bd3359 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/custom_audience_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/custom_audience.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/custom_audience_member_type_pb' +require 'google/ads/google_ads/v16/enums/custom_audience_status_pb' +require 'google/ads/google_ads/v16/enums/custom_audience_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/resources/custom_audience.proto\x12\"google.ads.googleads.v16.resources\x1a@google/ads/googleads/v16/enums/custom_audience_member_type.proto\x1a;google/ads/googleads/v16/enums/custom_audience_status.proto\x1a\x39google/ads/googleads/v16/enums/custom_audience_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x80\x04\n\x0e\x43ustomAudience\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x05\xfa\x41)\n\'googleads.googleapis.com/CustomAudience\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x62\n\x06status\x18\x03 \x01(\x0e\x32M.google.ads.googleads.v16.enums.CustomAudienceStatusEnum.CustomAudienceStatusB\x03\xe0\x41\x03\x12\x0c\n\x04name\x18\x04 \x01(\t\x12W\n\x04type\x18\x05 \x01(\x0e\x32I.google.ads.googleads.v16.enums.CustomAudienceTypeEnum.CustomAudienceType\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12I\n\x07members\x18\x07 \x03(\x0b\x32\x38.google.ads.googleads.v16.resources.CustomAudienceMember:j\xea\x41g\n\'googleads.googleapis.com/CustomAudience\x12google/ads/googleads/v16/enums/asset_link_primary_status.proto\x1a\x45google/ads/googleads/v16/enums/asset_link_primary_status_reason.proto\x1a\x36google/ads/googleads/v16/enums/asset_link_status.proto\x1a\x31google/ads/googleads/v16/enums/asset_source.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdd\x06\n\rCustomerAsset\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xe0\x41\x05\xfa\x41(\n&googleads.googleapis.com/CustomerAsset\x12\x38\n\x05\x61sset\x18\x02 \x01(\tB)\xe0\x41\x02\xe0\x41\x05\xfa\x41 \n\x1egoogleads.googleapis.com/Asset\x12]\n\nfield_type\x18\x03 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetFieldTypeEnum.AssetFieldTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12P\n\x06source\x18\x05 \x01(\x0e\x32;.google.ads.googleads.v16.enums.AssetSourceEnum.AssetSourceB\x03\xe0\x41\x03\x12S\n\x06status\x18\x04 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.AssetLinkStatusEnum.AssetLinkStatus\x12n\n\x0eprimary_status\x18\x06 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.AssetLinkPrimaryStatusEnum.AssetLinkPrimaryStatusB\x03\xe0\x41\x03\x12\x63\n\x16primary_status_details\x18\x07 \x03(\x0b\x32>.google.ads.googleads.v16.common.AssetLinkPrimaryStatusDetailsB\x03\xe0\x41\x03\x12\x82\x01\n\x16primary_status_reasons\x18\x08 \x03(\x0e\x32].google.ads.googleads.v16.enums.AssetLinkPrimaryStatusReasonEnum.AssetLinkPrimaryStatusReasonB\x03\xe0\x41\x03:k\xea\x41h\n&googleads.googleapis.com/CustomerAsset\x12>customers/{customer_id}/customerAssets/{asset_id}~{field_type}B\x84\x02\n&com.google.ads.googleads.v16.resourcesB\x12\x43ustomerAssetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AssetLinkPrimaryStatusDetails", "google/ads/googleads/v16/common/asset_policy.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CustomerAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerAsset").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/customer_asset_set_pb.rb b/lib/google/ads/google_ads/v16/resources/customer_asset_set_pb.rb new file mode 100644 index 000000000..a31176846 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/customer_asset_set_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/customer_asset_set.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/asset_set_link_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/resources/customer_asset_set.proto\x12\"google.ads.googleads.v16.resources\x1a:google/ads/googleads/v16/enums/asset_set_link_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa1\x03\n\x10\x43ustomerAssetSet\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x05\xfa\x41+\n)googleads.googleapis.com/CustomerAssetSet\x12<\n\tasset_set\x18\x02 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/AssetSet\x12;\n\x08\x63ustomer\x18\x03 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/Customer\x12^\n\x06status\x18\x04 \x01(\x0e\x32I.google.ads.googleads.v16.enums.AssetSetLinkStatusEnum.AssetSetLinkStatusB\x03\xe0\x41\x03:h\xea\x41\x65\n)googleads.googleapis.com/CustomerAssetSet\x12\x38\x63ustomers/{customer_id}/customerAssetSets/{asset_set_id}B\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15\x43ustomerAssetSetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CustomerAssetSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerAssetSet").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/customer_client_link_pb.rb b/lib/google/ads/google_ads/v16/resources/customer_client_link_pb.rb new file mode 100644 index 000000000..90fce8d0e --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/customer_client_link_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/customer_client_link.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/manager_link_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/resources/customer_client_link.proto\x12\"google.ads.googleads.v16.resources\x1a\x38google/ads/googleads/v16/enums/manager_link_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf5\x03\n\x12\x43ustomerClientLink\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x05\xfa\x41-\n+googleads.googleapis.com/CustomerClientLink\x12G\n\x0f\x63lient_customer\x18\x07 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/CustomerH\x00\x88\x01\x01\x12!\n\x0fmanager_link_id\x18\x08 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12W\n\x06status\x18\x05 \x01(\x0e\x32G.google.ads.googleads.v16.enums.ManagerLinkStatusEnum.ManagerLinkStatus\x12\x13\n\x06hidden\x18\t \x01(\x08H\x02\x88\x01\x01:\x85\x01\xea\x41\x81\x01\n+googleads.googleapis.com/CustomerClientLink\x12Rcustomers/{customer_id}/customerClientLinks/{client_customer_id}~{manager_link_id}B\x12\n\x10_client_customerB\x12\n\x10_manager_link_idB\t\n\x07_hiddenB\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17\x43ustomerClientLinkProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CustomerClientLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerClientLink").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/customer_client_pb.rb b/lib/google/ads/google_ads/v16/resources/customer_client_pb.rb new file mode 100644 index 000000000..43a83b8ff --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/customer_client_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/customer_client.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/customer_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/resources/customer_client.proto\x12\"google.ads.googleads.v16.resources\x1a\x34google/ads/googleads/v16/enums/customer_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x8d\x06\n\x0e\x43ustomerClient\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'googleads.googleapis.com/CustomerClient\x12G\n\x0f\x63lient_customer\x18\x0c \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/CustomerH\x00\x88\x01\x01\x12\x18\n\x06hidden\x18\r \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x17\n\x05level\x18\x0e \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1b\n\ttime_zone\x18\x0f \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x1e\n\x0ctest_account\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\x19\n\x07manager\x18\x11 \x01(\x08\x42\x03\xe0\x41\x03H\x05\x88\x01\x01\x12\"\n\x10\x64\x65scriptive_name\x18\x12 \x01(\tB\x03\xe0\x41\x03H\x06\x88\x01\x01\x12\x1f\n\rcurrency_code\x18\x13 \x01(\tB\x03\xe0\x41\x03H\x07\x88\x01\x01\x12\x14\n\x02id\x18\x14 \x01(\x03\x42\x03\xe0\x41\x03H\x08\x88\x01\x01\x12>\n\x0e\x61pplied_labels\x18\x15 \x03(\tB&\xe0\x41\x03\xfa\x41 \n\x1egoogleads.googleapis.com/Label\x12V\n\x06status\x18\x16 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.CustomerStatusEnum.CustomerStatusB\x03\xe0\x41\x03:j\xea\x41g\n\'googleads.googleapis.com/CustomerClient\x12\n,location_asset_auto_migration_done_date_time\x18( \x01(\tB\x03\xe0\x41\x03H\r\x88\x01\x01\x12;\n)image_asset_auto_migration_done_date_time\x18) \x01(\tB\x03\xe0\x41\x03H\x0e\x88\x01\x01\x12\x65\n\x1a\x63ustomer_agreement_setting\x18, \x01(\x0b\x32<.google.ads.googleads.v16.resources.CustomerAgreementSettingB\x03\xe0\x41\x03\x12_\n\x17local_services_settings\x18- \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.LocalServicesSettingsB\x03\xe0\x41\x03:?\xea\x41<\n!googleads.googleapis.com/Customer\x12\x17\x63ustomers/{customer_id}B\x05\n\x03_idB\x13\n\x11_descriptive_nameB\x10\n\x0e_currency_codeB\x0c\n\n_time_zoneB\x18\n\x16_tracking_url_templateB\x13\n\x11_final_url_suffixB\x17\n\x15_auto_tagging_enabledB\x15\n\x13_has_partners_badgeB\n\n\x08_managerB\x0f\n\r_test_accountB\x15\n\x13_optimization_scoreB%\n#_location_asset_auto_migration_doneB\"\n _image_asset_auto_migration_doneB/\n-_location_asset_auto_migration_done_date_timeB,\n*_image_asset_auto_migration_done_date_time\"\x9c\x02\n\x14\x43\x61llReportingSetting\x12#\n\x16\x63\x61ll_reporting_enabled\x18\n \x01(\x08H\x00\x88\x01\x01\x12.\n!call_conversion_reporting_enabled\x18\x0b \x01(\x08H\x01\x88\x01\x01\x12S\n\x16\x63\x61ll_conversion_action\x18\x0c \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/ConversionActionH\x02\x88\x01\x01\x42\x19\n\x17_call_reporting_enabledB$\n\"_call_conversion_reporting_enabledB\x19\n\x17_call_conversion_action\"\xce\x03\n\x19\x43onversionTrackingSetting\x12(\n\x16\x63onversion_tracking_id\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x36\n$cross_account_conversion_tracking_id\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12)\n\x1c\x61\x63\x63\x65pted_customer_data_terms\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12~\n\x1a\x63onversion_tracking_status\x18\x06 \x01(\x0e\x32U.google.ads.googleads.v16.enums.ConversionTrackingStatusEnum.ConversionTrackingStatusB\x03\xe0\x41\x03\x12\x33\n&enhanced_conversions_for_leads_enabled\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\x1egoogle_ads_conversion_customer\x18\x08 \x01(\tB\x03\xe0\x41\x03\x42\x19\n\x17_conversion_tracking_idB\'\n%_cross_account_conversion_tracking_id\"Y\n\x12RemarketingSetting\x12(\n\x16google_global_site_tag\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x19\n\x17_google_global_site_tag\"A\n\x18\x43ustomerAgreementSetting\x12%\n\x18\x61\x63\x63\x65pted_lead_form_terms\x18\x01 \x01(\x08\x42\x03\xe0\x41\x03\"\xe1\x01\n\x15LocalServicesSettings\x12\x61\n\x19granular_license_statuses\x18\x01 \x03(\x0b\x32\x39.google.ads.googleads.v16.resources.GranularLicenseStatusB\x03\xe0\x41\x03\x12\x65\n\x1bgranular_insurance_statuses\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.resources.GranularInsuranceStatusB\x03\xe0\x41\x03\"\xa4\x02\n\x15GranularLicenseStatus\x12\"\n\x10geo_criterion_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1d\n\x0b\x63\x61tegory_id\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x8a\x01\n\x13verification_status\x18\x03 \x01(\x0e\x32\x63.google.ads.googleads.v16.enums.LocalServicesVerificationStatusEnum.LocalServicesVerificationStatusB\x03\xe0\x41\x03H\x02\x88\x01\x01\x42\x13\n\x11_geo_criterion_idB\x0e\n\x0c_category_idB\x16\n\x14_verification_status\"\xa6\x02\n\x17GranularInsuranceStatus\x12\"\n\x10geo_criterion_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1d\n\x0b\x63\x61tegory_id\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x8a\x01\n\x13verification_status\x18\x03 \x01(\x0e\x32\x63.google.ads.googleads.v16.enums.LocalServicesVerificationStatusEnum.LocalServicesVerificationStatusB\x03\xe0\x41\x03H\x02\x88\x01\x01\x42\x13\n\x11_geo_criterion_idB\x0e\n\x0c_category_idB\x16\n\x14_verification_statusB\xff\x01\n&com.google.ads.googleads.v16.resourcesB\rCustomerProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + Customer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Customer").msgclass + CallReportingSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CallReportingSetting").msgclass + ConversionTrackingSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ConversionTrackingSetting").msgclass + RemarketingSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.RemarketingSetting").msgclass + CustomerAgreementSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerAgreementSetting").msgclass + LocalServicesSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LocalServicesSettings").msgclass + GranularLicenseStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.GranularLicenseStatus").msgclass + GranularInsuranceStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.GranularInsuranceStatus").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/customer_search_term_insight_pb.rb b/lib/google/ads/google_ads/v16/resources/customer_search_term_insight_pb.rb new file mode 100644 index 000000000..1a740ccf6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/customer_search_term_insight_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/customer_search_term_insight.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/resources/customer_search_term_insight.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xba\x02\n\x19\x43ustomerSearchTermInsight\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xe0\x41\x03\xfa\x41\x34\n2googleads.googleapis.com/CustomerSearchTermInsight\x12 \n\x0e\x63\x61tegory_label\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x14\n\x02id\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01:x\xea\x41u\n2googleads.googleapis.com/CustomerSearchTermInsight\x12?customers/{customer_id}/customerSearchTermInsights/{cluster_id}B\x11\n\x0f_category_labelB\x05\n\x03_idB\x90\x02\n&com.google.ads.googleads.v16.resourcesB\x1e\x43ustomerSearchTermInsightProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CustomerSearchTermInsight = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerSearchTermInsight").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/customer_sk_ad_network_conversion_value_schema_pb.rb b/lib/google/ads/google_ads/v16/resources/customer_sk_ad_network_conversion_value_schema_pb.rb new file mode 100644 index 000000000..2946931f1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/customer_sk_ad_network_conversion_value_schema_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/customer_sk_ad_network_conversion_value_schema.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nWgoogle/ads/googleads/v16/resources/customer_sk_ad_network_conversion_value_schema.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x85\x0f\n(CustomerSkAdNetworkConversionValueSchema\x12`\n\rresource_name\x18\x01 \x01(\tBI\xe0\x41\x03\xfa\x41\x43\nAgoogleads.googleapis.com/CustomerSkAdNetworkConversionValueSchema\x12\x82\x01\n\x06schema\x18\x02 \x01(\x0b\x32m.google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchemaB\x03\xe0\x41\x03\x1a\xd2\x0b\n SkAdNetworkConversionValueSchema\x12\x16\n\x06\x61pp_id\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x03\x12%\n\x18measurement_window_hours\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\xc6\x01\n&fine_grained_conversion_value_mappings\x18\x03 \x03(\x0b\x32\x90\x01.google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.FineGrainedConversionValueMappingsB\x03\xe0\x41\x03\x1a\xff\x01\n\"FineGrainedConversionValueMappings\x12*\n\x1d\x66ine_grained_conversion_value\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\xac\x01\n\x18\x63onversion_value_mapping\x18\x02 \x01(\x0b\x32\x84\x01.google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.ConversionValueMappingB\x03\xe0\x41\x03\x1a\xfe\x01\n\x16\x43onversionValueMapping\x12(\n\x1bmin_time_post_install_hours\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12(\n\x1bmax_time_post_install_hours\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x8f\x01\n\rmapped_events\x18\x03 \x03(\x0b\x32s.google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.EventB\x03\xe0\x41\x03\x1a\xa2\x05\n\x05\x45vent\x12\x1e\n\x11mapped_event_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rcurrency_code\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\xa5\x01\n\x13\x65vent_revenue_range\x18\x03 \x01(\x0b\x32\x80\x01.google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.Event.RevenueRangeB\x03\xe0\x41\x03H\x00\x12\"\n\x13\x65vent_revenue_value\x18\x04 \x01(\x01\x42\x03\xe0\x41\x03H\x00\x12\xb0\x01\n\x16\x65vent_occurrence_range\x18\x05 \x01(\x0b\x32\x88\x01.google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.Event.EventOccurrenceRangeB\x03\xe0\x41\x03H\x01\x12\x1c\n\revent_counter\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x1aN\n\x0cRevenueRange\x12\x1e\n\x11min_event_revenue\x18\x03 \x01(\x01\x42\x03\xe0\x41\x03\x12\x1e\n\x11max_event_revenue\x18\x04 \x01(\x01\x42\x03\xe0\x41\x03\x1aR\n\x14\x45ventOccurrenceRange\x12\x1c\n\x0fmin_event_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1c\n\x0fmax_event_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x42\x0e\n\x0crevenue_rateB\x0c\n\nevent_rate:\x9c\x01\xea\x41\x98\x01\nAgoogleads.googleapis.com/CustomerSkAdNetworkConversionValueSchema\x12Scustomers/{customer_id}/customerSkAdNetworkConversionValueSchemas/{account_link_id}B\x9f\x02\n&com.google.ads.googleads.v16.resourcesB-CustomerSkAdNetworkConversionValueSchemaProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CustomerSkAdNetworkConversionValueSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema").msgclass + CustomerSkAdNetworkConversionValueSchema::SkAdNetworkConversionValueSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema").msgclass + CustomerSkAdNetworkConversionValueSchema::SkAdNetworkConversionValueSchema::FineGrainedConversionValueMappings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.FineGrainedConversionValueMappings").msgclass + CustomerSkAdNetworkConversionValueSchema::SkAdNetworkConversionValueSchema::ConversionValueMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.ConversionValueMapping").msgclass + CustomerSkAdNetworkConversionValueSchema::SkAdNetworkConversionValueSchema::Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.Event").msgclass + CustomerSkAdNetworkConversionValueSchema::SkAdNetworkConversionValueSchema::Event::RevenueRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.Event.RevenueRange").msgclass + CustomerSkAdNetworkConversionValueSchema::SkAdNetworkConversionValueSchema::Event::EventOccurrenceRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema.SkAdNetworkConversionValueSchema.Event.EventOccurrenceRange").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/customer_user_access_invitation_pb.rb b/lib/google/ads/google_ads/v16/resources/customer_user_access_invitation_pb.rb new file mode 100644 index 000000000..817f97b7f --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/customer_user_access_invitation_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/customer_user_access_invitation.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/access_invitation_status_pb' +require 'google/ads/google_ads/v16/enums/access_role_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nHgoogle/ads/googleads/v16/resources/customer_user_access_invitation.proto\x12\"google.ads.googleads.v16.resources\x1a=google/ads/googleads/v16/enums/access_invitation_status.proto\x1a\x30google/ads/googleads/v16/enums/access_role.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x99\x04\n\x1c\x43ustomerUserAccessInvitation\x12T\n\rresource_name\x18\x01 \x01(\tB=\xe0\x41\x05\xfa\x41\x37\n5googleads.googleapis.com/CustomerUserAccessInvitation\x12\x1a\n\rinvitation_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12S\n\x0b\x61\x63\x63\x65ss_role\x18\x03 \x01(\x0e\x32\x39.google.ads.googleads.v16.enums.AccessRoleEnum.AccessRoleB\x03\xe0\x41\x05\x12\x1a\n\remail_address\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12\x1f\n\x12\x63reation_date_time\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12q\n\x11invitation_status\x18\x06 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.AccessInvitationStatusEnum.AccessInvitationStatusB\x03\xe0\x41\x03:\x81\x01\xea\x41~\n5googleads.googleapis.com/CustomerUserAccessInvitation\x12\x45\x63ustomers/{customer_id}/customerUserAccessInvitations/{invitation_id}B\x93\x02\n&com.google.ads.googleads.v16.resourcesB!CustomerUserAccessInvitationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CustomerUserAccessInvitation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerUserAccessInvitation").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/customer_user_access_pb.rb b/lib/google/ads/google_ads/v16/resources/customer_user_access_pb.rb new file mode 100644 index 000000000..6f6e9ffbb --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/customer_user_access_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/customer_user_access.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/access_role_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/resources/customer_user_access.proto\x12\"google.ads.googleads.v16.resources\x1a\x30google/ads/googleads/v16/enums/access_role.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xfb\x03\n\x12\x43ustomerUserAccess\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x05\xfa\x41-\n+googleads.googleapis.com/CustomerUserAccess\x12\x14\n\x07user_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1f\n\remail_address\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12N\n\x0b\x61\x63\x63\x65ss_role\x18\x04 \x01(\x0e\x32\x39.google.ads.googleads.v16.enums.AccessRoleEnum.AccessRole\x12+\n\x19\x61\x63\x63\x65ss_creation_date_time\x18\x06 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12,\n\x1ainviter_user_email_address\x18\x07 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01:h\xea\x41\x65\n+googleads.googleapis.com/CustomerUserAccess\x12\x36\x63ustomers/{customer_id}/customerUserAccesses/{user_id}B\x10\n\x0e_email_addressB\x1c\n\x1a_access_creation_date_timeB\x1d\n\x1b_inviter_user_email_addressB\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17\x43ustomerUserAccessProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CustomerUserAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomerUserAccess").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/customizer_attribute_pb.rb b/lib/google/ads/google_ads/v16/resources/customizer_attribute_pb.rb new file mode 100644 index 000000000..db9ad948e --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/customizer_attribute_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/customizer_attribute.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/customizer_attribute_status_pb' +require 'google/ads/google_ads/v16/enums/customizer_attribute_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/resources/customizer_attribute.proto\x12\"google.ads.googleads.v16.resources\x1a@google/ads/googleads/v16/enums/customizer_attribute_status.proto\x1a>google/ads/googleads/v16/enums/customizer_attribute_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xda\x03\n\x13\x43ustomizerAttribute\x12K\n\rresource_name\x18\x01 \x01(\tB4\xe0\x41\x05\xfa\x41.\n,googleads.googleapis.com/CustomizerAttribute\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x14\n\x04name\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x66\n\x04type\x18\x04 \x01(\x0e\x32S.google.ads.googleads.v16.enums.CustomizerAttributeTypeEnum.CustomizerAttributeTypeB\x03\xe0\x41\x05\x12l\n\x06status\x18\x05 \x01(\x0e\x32W.google.ads.googleads.v16.enums.CustomizerAttributeStatusEnum.CustomizerAttributeStatusB\x03\xe0\x41\x03:y\xea\x41v\n,googleads.googleapis.com/CustomizerAttribute\x12\x46\x63ustomers/{customer_id}/customizerAttributes/{customizer_attribute_id}B\x8a\x02\n&com.google.ads.googleads.v16.resourcesB\x18\x43ustomizerAttributeProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + CustomizerAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomizerAttribute").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/detail_placement_view_pb.rb b/lib/google/ads/google_ads/v16/resources/detail_placement_view_pb.rb new file mode 100644 index 000000000..5af16461e --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/detail_placement_view_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/detail_placement_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/placement_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/resources/detail_placement_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x33google/ads/googleads/v16/enums/placement_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x99\x04\n\x13\x44\x65tailPlacementView\x12K\n\rresource_name\x18\x01 \x01(\tB4\xe0\x41\x03\xfa\x41.\n,googleads.googleapis.com/DetailPlacementView\x12\x1b\n\tplacement\x18\x07 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1e\n\x0c\x64isplay_name\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12,\n\x1agroup_placement_target_url\x18\t \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1c\n\ntarget_url\x18\n \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\\\n\x0eplacement_type\x18\x06 \x01(\x0e\x32?.google.ads.googleads.v16.enums.PlacementTypeEnum.PlacementTypeB\x03\xe0\x41\x03:\x80\x01\xea\x41}\n,googleads.googleapis.com/DetailPlacementView\x12Mcustomers/{customer_id}/detailPlacementViews/{ad_group_id}~{base64_placement}B\x0c\n\n_placementB\x0f\n\r_display_nameB\x1d\n\x1b_group_placement_target_urlB\r\n\x0b_target_urlB\x8a\x02\n&com.google.ads.googleads.v16.resourcesB\x18\x44\x65tailPlacementViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + DetailPlacementView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.DetailPlacementView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/detailed_demographic_pb.rb b/lib/google/ads/google_ads/v16/resources/detailed_demographic_pb.rb new file mode 100644 index 000000000..ce4691916 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/detailed_demographic_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/detailed_demographic.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criterion_category_availability_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/resources/detailed_demographic.proto\x12\"google.ads.googleads.v16.resources\x1a\x45google/ads/googleads/v16/common/criterion_category_availability.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc2\x03\n\x13\x44\x65tailedDemographic\x12K\n\rresource_name\x18\x01 \x01(\tB4\xe0\x41\x03\xfa\x41.\n,googleads.googleapis.com/DetailedDemographic\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x06parent\x18\x04 \x01(\tB4\xe0\x41\x03\xfa\x41.\n,googleads.googleapis.com/DetailedDemographic\x12\x1c\n\x0flaunched_to_all\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12[\n\x0e\x61vailabilities\x18\x06 \x03(\x0b\x32>.google.ads.googleads.v16.common.CriterionCategoryAvailabilityB\x03\xe0\x41\x03:y\xea\x41v\n,googleads.googleapis.com/DetailedDemographic\x12\x46\x63ustomers/{customer_id}/detailedDemographics/{detailed_demographic_id}B\x8a\x02\n&com.google.ads.googleads.v16.resourcesB\x18\x44\x65tailedDemographicProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CriterionCategoryAvailability", "google/ads/googleads/v16/common/criterion_category_availability.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + DetailedDemographic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.DetailedDemographic").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/display_keyword_view_pb.rb b/lib/google/ads/google_ads/v16/resources/display_keyword_view_pb.rb new file mode 100644 index 000000000..4bc31df71 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/display_keyword_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/display_keyword_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/resources/display_keyword_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdc\x01\n\x12\x44isplayKeywordView\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x03\xfa\x41-\n+googleads.googleapis.com/DisplayKeywordView:z\xea\x41w\n+googleads.googleapis.com/DisplayKeywordView\x12Hcustomers/{customer_id}/displayKeywordViews/{ad_group_id}~{criterion_id}B\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17\x44isplayKeywordViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + DisplayKeywordView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.DisplayKeywordView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/distance_view_pb.rb b/lib/google/ads/google_ads/v16/resources/distance_view_pb.rb new file mode 100644 index 000000000..c4a460c3e --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/distance_view_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/distance_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/distance_bucket_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n6google/ads/googleads/v16/resources/distance_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x34google/ads/googleads/v16/enums/distance_bucket.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe4\x02\n\x0c\x44istanceView\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%googleads.googleapis.com/DistanceView\x12_\n\x0f\x64istance_bucket\x18\x02 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.DistanceBucketEnum.DistanceBucketB\x03\xe0\x41\x03\x12\x1f\n\rmetric_system\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01:z\xea\x41w\n%googleads.googleapis.com/DistanceView\x12Ncustomers/{customer_id}/distanceViews/{placeholder_chain_id}~{distance_bucket}B\x10\n\x0e_metric_systemB\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11\x44istanceViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + DistanceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.DistanceView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/domain_category_pb.rb b/lib/google/ads/google_ads/v16/resources/domain_category_pb.rb new file mode 100644 index 000000000..0b3500332 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/domain_category_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/domain_category.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/resources/domain_category.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9e\x05\n\x0e\x44omainCategory\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'googleads.googleapis.com/DomainCategory\x12@\n\x08\x63\x61mpaign\x18\n \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/CampaignH\x00\x88\x01\x01\x12\x1a\n\x08\x63\x61tegory\x18\x0b \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rlanguage_code\x18\x0c \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x18\n\x06\x64omain\x18\r \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12#\n\x11\x63overage_fraction\x18\x0e \x01(\x01\x42\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\x1f\n\rcategory_rank\x18\x0f \x01(\x03\x42\x03\xe0\x41\x03H\x05\x88\x01\x01\x12\x1e\n\x0chas_children\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03H\x06\x88\x01\x01\x12,\n\x1arecommended_cpc_bid_micros\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03H\x07\x88\x01\x01:\x87\x01\xea\x41\x83\x01\n\'googleads.googleapis.com/DomainCategory\x12Xcustomers/{customer_id}/domainCategories/{campaign_id}~{base64_category}~{language_code}B\x0b\n\t_campaignB\x0b\n\t_categoryB\x10\n\x0e_language_codeB\t\n\x07_domainB\x14\n\x12_coverage_fractionB\x10\n\x0e_category_rankB\x0f\n\r_has_childrenB\x1d\n\x1b_recommended_cpc_bid_microsB\x85\x02\n&com.google.ads.googleads.v16.resourcesB\x13\x44omainCategoryProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + DomainCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.DomainCategory").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/dynamic_search_ads_search_term_view_pb.rb b/lib/google/ads/google_ads/v16/resources/dynamic_search_ads_search_term_view_pb.rb new file mode 100644 index 000000000..9b373239f --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/dynamic_search_ads_search_term_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/dynamic_search_ads_search_term_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nLgoogle/ads/googleads/v16/resources/dynamic_search_ads_search_term_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd0\x05\n\x1e\x44ynamicSearchAdsSearchTermView\x12V\n\rresource_name\x18\x01 \x01(\tB?\xe0\x41\x03\xfa\x41\x39\n7googleads.googleapis.com/DynamicSearchAdsSearchTermView\x12\x1d\n\x0bsearch_term\x18\t \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1a\n\x08headline\x18\n \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1e\n\x0clanding_page\x18\x0b \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1a\n\x08page_url\x18\x0c \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12&\n\x14has_negative_keyword\x18\r \x01(\x08\x42\x03\xe0\x41\x03H\x04\x88\x01\x01\x12&\n\x14has_matching_keyword\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03H\x05\x88\x01\x01\x12\"\n\x10has_negative_url\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03H\x06\x88\x01\x01:\xe8\x01\xea\x41\xe4\x01\n7googleads.googleapis.com/DynamicSearchAdsSearchTermView\x12\xa8\x01\x63ustomers/{customer_id}/dynamicSearchAdsSearchTermViews/{ad_group_id}~{search_term_fingerprint}~{headline_fingerprint}~{landing_page_fingerprint}~{page_url_fingerprint}B\x0e\n\x0c_search_termB\x0b\n\t_headlineB\x0f\n\r_landing_pageB\x0b\n\t_page_urlB\x17\n\x15_has_negative_keywordB\x17\n\x15_has_matching_keywordB\x13\n\x11_has_negative_urlB\x95\x02\n&com.google.ads.googleads.v16.resourcesB#DynamicSearchAdsSearchTermViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + DynamicSearchAdsSearchTermView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.DynamicSearchAdsSearchTermView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/expanded_landing_page_view_pb.rb b/lib/google/ads/google_ads/v16/resources/expanded_landing_page_view_pb.rb new file mode 100644 index 000000000..738786cef --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/expanded_landing_page_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/expanded_landing_page_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/resources/expanded_landing_page_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb3\x02\n\x17\x45xpandedLandingPageView\x12O\n\rresource_name\x18\x01 \x01(\tB8\xe0\x41\x03\xfa\x41\x32\n0googleads.googleapis.com/ExpandedLandingPageView\x12$\n\x12\x65xpanded_final_url\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01:\x89\x01\xea\x41\x85\x01\n0googleads.googleapis.com/ExpandedLandingPageView\x12Qcustomers/{customer_id}/expandedLandingPageViews/{expanded_final_url_fingerprint}B\x15\n\x13_expanded_final_urlB\x8e\x02\n&com.google.ads.googleads.v16.resourcesB\x1c\x45xpandedLandingPageViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ExpandedLandingPageView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ExpandedLandingPageView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/experiment_arm_pb.rb b/lib/google/ads/google_ads/v16/resources/experiment_arm_pb.rb new file mode 100644 index 000000000..d1c1f42f7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/experiment_arm_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/experiment_arm.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n7google/ads/googleads/v16/resources/experiment_arm.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc4\x03\n\rExperimentArm\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xe0\x41\x05\xfa\x41(\n&googleads.googleapis.com/ExperimentArm\x12?\n\nexperiment\x18\x08 \x01(\tB+\xe0\x41\x05\xfa\x41%\n#googleads.googleapis.com/Experiment\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63ontrol\x18\x04 \x01(\x08\x12\x15\n\rtraffic_split\x18\x05 \x01(\x03\x12\x39\n\tcampaigns\x18\x06 \x03(\tB&\xfa\x41#\n!googleads.googleapis.com/Campaign\x12\x46\n\x13in_design_campaigns\x18\x07 \x03(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Campaign:m\xea\x41j\n&googleads.googleapis.com/ExperimentArm\x12@customers/{customer_id}/experimentArms/{trial_id}~{trial_arm_id}B\x84\x02\n&com.google.ads.googleads.v16.resourcesB\x12\x45xperimentArmProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ExperimentArm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ExperimentArm").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/experiment_pb.rb b/lib/google/ads/google_ads/v16/resources/experiment_pb.rb new file mode 100644 index 000000000..d9b2b22d1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/experiment_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/experiment.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/metric_goal_pb' +require 'google/ads/google_ads/v16/enums/async_action_status_pb' +require 'google/ads/google_ads/v16/enums/experiment_status_pb' +require 'google/ads/google_ads/v16/enums/experiment_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/ads/googleads/v16/resources/experiment.proto\x12\"google.ads.googleads.v16.resources\x1a\x31google/ads/googleads/v16/common/metric_goal.proto\x1a\x38google/ads/googleads/v16/enums/async_action_status.proto\x1a\x36google/ads/googleads/v16/enums/experiment_status.proto\x1a\x34google/ads/googleads/v16/enums/experiment_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa6\x06\n\nExperiment\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xe0\x41\x05\xfa\x41%\n#googleads.googleapis.com/Experiment\x12\x1f\n\rexperiment_id\x18\t \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x11\n\x04name\x18\n \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x0b \x01(\t\x12\x0e\n\x06suffix\x18\x0c \x01(\t\x12T\n\x04type\x18\r \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.ExperimentTypeEnum.ExperimentTypeB\x03\xe0\x41\x02\x12U\n\x06status\x18\x0e \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.ExperimentStatusEnum.ExperimentStatus\x12\x17\n\nstart_date\x18\x0f \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08\x65nd_date\x18\x10 \x01(\tH\x02\x88\x01\x01\x12:\n\x05goals\x18\x11 \x03(\x0b\x32+.google.ads.googleads.v16.common.MetricGoal\x12(\n\x16long_running_operation\x18\x12 \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x64\n\x0epromote_status\x18\x13 \x01(\x0e\x32G.google.ads.googleads.v16.enums.AsyncActionStatusEnum.AsyncActionStatusB\x03\xe0\x41\x03\x12\x1e\n\x0csync_enabled\x18\x14 \x01(\x08\x42\x03\xe0\x41\x05H\x04\x88\x01\x01:X\xea\x41U\n#googleads.googleapis.com/Experiment\x12.customers/{customer_id}/experiments/{trial_id}B\x10\n\x0e_experiment_idB\r\n\x0b_start_dateB\x0b\n\t_end_dateB\x19\n\x17_long_running_operationB\x0f\n\r_sync_enabledB\x81\x02\n&com.google.ads.googleads.v16.resourcesB\x0f\x45xperimentProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.MetricGoal", "google/ads/googleads/v16/common/metric_goal.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + Experiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Experiment").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/extension_feed_item_pb.rb b/lib/google/ads/google_ads/v16/resources/extension_feed_item_pb.rb new file mode 100644 index 000000000..cacbb364a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/extension_feed_item_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/extension_feed_item.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/common/extensions_pb' +require 'google/ads/google_ads/v16/enums/extension_type_pb' +require 'google/ads/google_ads/v16/enums/feed_item_status_pb' +require 'google/ads/google_ads/v16/enums/feed_item_target_device_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\ngoogle/ads/googleads/v16/enums/geo_targeting_restriction.proto\x1a\x35google/ads/googleads/v16/enums/placeholder_type.proto\x1a;google/ads/googleads/v16/enums/policy_approval_status.proto\x1a\x39google/ads/googleads/v16/enums/policy_review_status.proto\x1a@google/ads/googleads/v16/errors/feed_item_validation_error.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc5\x06\n\x08\x46\x65\x65\x64Item\x12@\n\rresource_name\x18\x01 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/FeedItem\x12\x38\n\x04\x66\x65\x65\x64\x18\x0b \x01(\tB%\xe0\x41\x05\xfa\x41\x1f\n\x1dgoogleads.googleapis.com/FeedH\x00\x88\x01\x01\x12\x14\n\x02id\x18\x0c \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1c\n\x0fstart_date_time\x18\r \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rend_date_time\x18\x0e \x01(\tH\x03\x88\x01\x01\x12T\n\x10\x61ttribute_values\x18\x06 \x03(\x0b\x32:.google.ads.googleads.v16.resources.FeedItemAttributeValue\x12v\n\x19geo_targeting_restriction\x18\x07 \x01(\x0e\x32S.google.ads.googleads.v16.enums.GeoTargetingRestrictionEnum.GeoTargetingRestriction\x12O\n\x15url_custom_parameters\x18\x08 \x03(\x0b\x32\x30.google.ads.googleads.v16.common.CustomParameter\x12V\n\x06status\x18\t \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.FeedItemStatusEnum.FeedItemStatusB\x03\xe0\x41\x03\x12\\\n\x0cpolicy_infos\x18\n \x03(\x0b\x32\x41.google.ads.googleads.v16.resources.FeedItemPlaceholderPolicyInfoB\x03\xe0\x41\x03:b\xea\x41_\n!googleads.googleapis.com/FeedItem\x12:customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}B\x07\n\x05_feedB\x05\n\x03_idB\x12\n\x10_start_date_timeB\x10\n\x0e_end_date_time\"\x9d\x03\n\x16\x46\x65\x65\x64ItemAttributeValue\x12\x1e\n\x11\x66\x65\x65\x64_attribute_id\x18\x0b \x01(\x03H\x00\x88\x01\x01\x12\x1a\n\rinteger_value\x18\x0c \x01(\x03H\x01\x88\x01\x01\x12\x1a\n\rboolean_value\x18\r \x01(\x08H\x02\x88\x01\x01\x12\x19\n\x0cstring_value\x18\x0e \x01(\tH\x03\x88\x01\x01\x12\x19\n\x0c\x64ouble_value\x18\x0f \x01(\x01H\x04\x88\x01\x01\x12;\n\x0bprice_value\x18\x06 \x01(\x0b\x32&.google.ads.googleads.v16.common.Money\x12\x16\n\x0einteger_values\x18\x10 \x03(\x03\x12\x16\n\x0e\x62oolean_values\x18\x11 \x03(\x08\x12\x15\n\rstring_values\x18\x12 \x03(\t\x12\x15\n\rdouble_values\x18\x13 \x03(\x01\x42\x14\n\x12_feed_attribute_idB\x10\n\x0e_integer_valueB\x10\n\x0e_boolean_valueB\x0f\n\r_string_valueB\x0f\n\r_double_value\"\xed\x07\n\x1d\x46\x65\x65\x64ItemPlaceholderPolicyInfo\x12g\n\x15placeholder_type_enum\x18\n \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.PlaceholderTypeEnum.PlaceholderTypeB\x03\xe0\x41\x03\x12,\n\x1a\x66\x65\x65\x64_mapping_resource_name\x18\x0b \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x65\n\rreview_status\x18\x03 \x01(\x0e\x32I.google.ads.googleads.v16.enums.PolicyReviewStatusEnum.PolicyReviewStatusB\x03\xe0\x41\x03\x12k\n\x0f\x61pproval_status\x18\x04 \x01(\x0e\x32M.google.ads.googleads.v16.enums.PolicyApprovalStatusEnum.PolicyApprovalStatusB\x03\xe0\x41\x03\x12T\n\x14policy_topic_entries\x18\x05 \x03(\x0b\x32\x31.google.ads.googleads.v16.common.PolicyTopicEntryB\x03\xe0\x41\x03\x12u\n\x11validation_status\x18\x06 \x01(\x0e\x32U.google.ads.googleads.v16.enums.FeedItemValidationStatusEnum.FeedItemValidationStatusB\x03\xe0\x41\x03\x12[\n\x11validation_errors\x18\x07 \x03(\x0b\x32;.google.ads.googleads.v16.resources.FeedItemValidationErrorB\x03\xe0\x41\x03\x12\x85\x01\n\x17quality_approval_status\x18\x08 \x01(\x0e\x32_.google.ads.googleads.v16.enums.FeedItemQualityApprovalStatusEnum.FeedItemQualityApprovalStatusB\x03\xe0\x41\x03\x12\x8f\x01\n\x1bquality_disapproval_reasons\x18\t \x03(\x0e\x32\x65.google.ads.googleads.v16.enums.FeedItemQualityDisapprovalReasonEnum.FeedItemQualityDisapprovalReasonB\x03\xe0\x41\x03\x42\x1d\n\x1b_feed_mapping_resource_name\"\x8b\x02\n\x17\x46\x65\x65\x64ItemValidationError\x12s\n\x10validation_error\x18\x01 \x01(\x0e\x32T.google.ads.googleads.v16.errors.FeedItemValidationErrorEnum.FeedItemValidationErrorB\x03\xe0\x41\x03\x12\x1d\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\x12\x66\x65\x65\x64_attribute_ids\x18\x07 \x03(\x03\x42\x03\xe0\x41\x03\x12\x1c\n\nextra_info\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x0e\n\x0c_descriptionB\r\n\x0b_extra_infoB\xff\x01\n&com.google.ads.googleads.v16.resourcesB\rFeedItemProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CustomParameter", "google/ads/googleads/v16/common/custom_parameter.proto"], + ["google.ads.googleads.v16.common.Money", "google/ads/googleads/v16/common/feed_common.proto"], + ["google.ads.googleads.v16.common.PolicyTopicEntry", "google/ads/googleads/v16/common/policy.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + FeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.FeedItem").msgclass + FeedItemAttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.FeedItemAttributeValue").msgclass + FeedItemPlaceholderPolicyInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.FeedItemPlaceholderPolicyInfo").msgclass + FeedItemValidationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.FeedItemValidationError").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/feed_item_set_link_pb.rb b/lib/google/ads/google_ads/v16/resources/feed_item_set_link_pb.rb new file mode 100644 index 000000000..0deddc4ad --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/feed_item_set_link_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/feed_item_set_link.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/resources/feed_item_set_link.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe4\x02\n\x0f\x46\x65\x65\x64ItemSetLink\x12G\n\rresource_name\x18\x01 \x01(\tB0\xe0\x41\x05\xfa\x41*\n(googleads.googleapis.com/FeedItemSetLink\x12<\n\tfeed_item\x18\x02 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/FeedItem\x12\x43\n\rfeed_item_set\x18\x03 \x01(\tB,\xe0\x41\x05\xfa\x41&\n$googleads.googleapis.com/FeedItemSet:\x84\x01\xea\x41\x80\x01\n(googleads.googleapis.com/FeedItemSetLink\x12Tcustomers/{customer_id}/feedItemSetLinks/{feed_id}~{feed_item_set_id}~{feed_item_id}B\x86\x02\n&com.google.ads.googleads.v16.resourcesB\x14\x46\x65\x65\x64ItemSetLinkProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + FeedItemSetLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.FeedItemSetLink").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/feed_item_set_pb.rb b/lib/google/ads/google_ads/v16/resources/feed_item_set_pb.rb new file mode 100644 index 000000000..eb808c0cc --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/feed_item_set_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/feed_item_set.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/feed_item_set_filter_type_infos_pb' +require 'google/ads/google_ads/v16/enums/feed_item_set_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n6google/ads/googleads/v16/resources/feed_item_set.proto\x12\"google.ads.googleads.v16.resources\x1a\x45google/ads/googleads/v16/common/feed_item_set_filter_type_infos.proto\x1a\x39google/ads/googleads/v16/enums/feed_item_set_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf5\x04\n\x0b\x46\x65\x65\x64ItemSet\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xe0\x41\x05\xfa\x41&\n$googleads.googleapis.com/FeedItemSet\x12\x33\n\x04\x66\x65\x65\x64\x18\x02 \x01(\tB%\xe0\x41\x05\xfa\x41\x1f\n\x1dgoogleads.googleapis.com/Feed\x12\x1d\n\x10\x66\x65\x65\x64_item_set_id\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\\\n\x06status\x18\x08 \x01(\x0e\x32G.google.ads.googleads.v16.enums.FeedItemSetStatusEnum.FeedItemSetStatusB\x03\xe0\x41\x03\x12`\n\x1b\x64ynamic_location_set_filter\x18\x05 \x01(\x0b\x32\x39.google.ads.googleads.v16.common.DynamicLocationSetFilterH\x00\x12s\n%dynamic_affiliate_location_set_filter\x18\x06 \x01(\x0b\x32\x42.google.ads.googleads.v16.common.DynamicAffiliateLocationSetFilterH\x00:l\xea\x41i\n$googleads.googleapis.com/FeedItemSet\x12\x41\x63ustomers/{customer_id}/feedItemSets/{feed_id}~{feed_item_set_id}B\x14\n\x12\x64ynamic_set_filterB\x82\x02\n&com.google.ads.googleads.v16.resourcesB\x10\x46\x65\x65\x64ItemSetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.DynamicLocationSetFilter", "google/ads/googleads/v16/common/feed_item_set_filter_type_infos.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + FeedItemSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.FeedItemSet").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/feed_item_target_pb.rb b/lib/google/ads/google_ads/v16/resources/feed_item_target_pb.rb new file mode 100644 index 000000000..89a1d25d2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/feed_item_target_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/feed_item_target.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/enums/feed_item_target_device_pb' +require 'google/ads/google_ads/v16/enums/feed_item_target_status_pb' +require 'google/ads/google_ads/v16/enums/feed_item_target_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/resources/feed_item_target.proto\x12\"google.ads.googleads.v16.resources\x1a.google/ads/googleads/v16/common/criteria.proto\x1agoogle/ads/googleads/v16/enums/callout_placeholder_field.proto\x1a=google/ads/googleads/v16/enums/custom_placeholder_field.proto\x1a\x42google/ads/googleads/v16/enums/dsa_page_feed_criterion_field.proto\x1a@google/ads/googleads/v16/enums/education_placeholder_field.proto\x1a@google/ads/googleads/v16/enums/feed_mapping_criterion_type.proto\x1a\x38google/ads/googleads/v16/enums/feed_mapping_status.proto\x1a=google/ads/googleads/v16/enums/flight_placeholder_field.proto\x1agoogle/ads/googleads/v16/enums/message_placeholder_field.proto\x1a\x35google/ads/googleads/v16/enums/placeholder_type.proto\x1agoogle/ads/googleads/v16/enums/google_ads_field_category.proto\x1a?google/ads/googleads/v16/enums/google_ads_field_data_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x82\x06\n\x0eGoogleAdsField\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'googleads.googleapis.com/GoogleAdsField\x12\x16\n\x04name\x18\x15 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12h\n\x08\x63\x61tegory\x18\x03 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.GoogleAdsFieldCategoryEnum.GoogleAdsFieldCategoryB\x03\xe0\x41\x03\x12\x1c\n\nselectable\x18\x16 \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1c\n\nfilterable\x18\x17 \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1a\n\x08sortable\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x1c\n\x0fselectable_with\x18\x19 \x03(\tB\x03\xe0\x41\x03\x12 \n\x13\x61ttribute_resources\x18\x1a \x03(\tB\x03\xe0\x41\x03\x12\x14\n\x07metrics\x18\x1b \x03(\tB\x03\xe0\x41\x03\x12\x15\n\x08segments\x18\x1c \x03(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x65num_values\x18\x1d \x03(\tB\x03\xe0\x41\x03\x12i\n\tdata_type\x18\x0c \x01(\x0e\x32Q.google.ads.googleads.v16.enums.GoogleAdsFieldDataTypeEnum.GoogleAdsFieldDataTypeB\x03\xe0\x41\x03\x12\x1a\n\x08type_url\x18\x1e \x01(\tB\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\x1d\n\x0bis_repeated\x18\x1f \x01(\x08\x42\x03\xe0\x41\x03H\x05\x88\x01\x01:P\xea\x41M\n\'googleads.googleapis.com/GoogleAdsField\x12\"googleAdsFields/{google_ads_field}B\x07\n\x05_nameB\r\n\x0b_selectableB\r\n\x0b_filterableB\x0b\n\t_sortableB\x0b\n\t_type_urlB\x0e\n\x0c_is_repeatedB\x85\x02\n&com.google.ads.googleads.v16.resourcesB\x13GoogleAdsFieldProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + GoogleAdsField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.GoogleAdsField").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/group_placement_view_pb.rb b/lib/google/ads/google_ads/v16/resources/group_placement_view_pb.rb new file mode 100644 index 000000000..f0fd22ab5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/group_placement_view_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/group_placement_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/placement_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/resources/group_placement_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x33google/ads/googleads/v16/enums/placement_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc7\x03\n\x12GroupPlacementView\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x03\xfa\x41-\n+googleads.googleapis.com/GroupPlacementView\x12\x1b\n\tplacement\x18\x06 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1e\n\x0c\x64isplay_name\x18\x07 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1c\n\ntarget_url\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\\\n\x0eplacement_type\x18\x05 \x01(\x0e\x32?.google.ads.googleads.v16.enums.PlacementTypeEnum.PlacementTypeB\x03\xe0\x41\x03:~\xea\x41{\n+googleads.googleapis.com/GroupPlacementView\x12Lcustomers/{customer_id}/groupPlacementViews/{ad_group_id}~{base64_placement}B\x0c\n\n_placementB\x0f\n\r_display_nameB\r\n\x0b_target_urlB\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17GroupPlacementViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + GroupPlacementView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.GroupPlacementView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/hotel_group_view_pb.rb b/lib/google/ads/google_ads/v16/resources/hotel_group_view_pb.rb new file mode 100644 index 000000000..eefbd4d9f --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/hotel_group_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/hotel_group_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/resources/hotel_group_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xcc\x01\n\x0eHotelGroupView\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'googleads.googleapis.com/HotelGroupView:r\xea\x41o\n\'googleads.googleapis.com/HotelGroupView\x12\x44\x63ustomers/{customer_id}/hotelGroupViews/{ad_group_id}~{criterion_id}B\x85\x02\n&com.google.ads.googleads.v16.resourcesB\x13HotelGroupViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + HotelGroupView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.HotelGroupView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/hotel_performance_view_pb.rb b/lib/google/ads/google_ads/v16/resources/hotel_performance_view_pb.rb new file mode 100644 index 000000000..eed6d5f9e --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/hotel_performance_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/hotel_performance_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/resources/hotel_performance_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc6\x01\n\x14HotelPerformanceView\x12L\n\rresource_name\x18\x01 \x01(\tB5\xe0\x41\x03\xfa\x41/\n-googleads.googleapis.com/HotelPerformanceView:`\xea\x41]\n-googleads.googleapis.com/HotelPerformanceView\x12,customers/{customer_id}/hotelPerformanceViewB\x8b\x02\n&com.google.ads.googleads.v16.resourcesB\x19HotelPerformanceViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + HotelPerformanceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.HotelPerformanceView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/hotel_reconciliation_pb.rb b/lib/google/ads/google_ads/v16/resources/hotel_reconciliation_pb.rb new file mode 100644 index 000000000..5799ebb4a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/hotel_reconciliation_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/hotel_reconciliation.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/hotel_reconciliation_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/resources/hotel_reconciliation.proto\x12\"google.ads.googleads.v16.resources\x1a@google/ads/googleads/v16/enums/hotel_reconciliation_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe3\x04\n\x13HotelReconciliation\x12K\n\rresource_name\x18\x01 \x01(\tB4\xe0\x41\x05\xfa\x41.\n,googleads.googleapis.com/HotelReconciliation\x12\x1d\n\rcommission_id\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x03\x12\x15\n\x08order_id\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12;\n\x08\x63\x61mpaign\x18\x0b \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Campaign\x12\x1c\n\x0fhotel_center_id\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12\x15\n\x08hotel_id\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rcheck_in_date\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0e\x63heck_out_date\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\'\n\x17reconciled_value_micros\x18\x08 \x01(\x03\x42\x06\xe0\x41\x02\xe0\x41\x03\x12\x13\n\x06\x62illed\x18\t \x01(\x08\x42\x03\xe0\x41\x03\x12o\n\x06status\x18\n \x01(\x0e\x32W.google.ads.googleads.v16.enums.HotelReconciliationStatusEnum.HotelReconciliationStatusB\x06\xe0\x41\x02\xe0\x41\x03:o\xea\x41l\n,googleads.googleapis.com/HotelReconciliation\x12\n,excess_credit_adjustment_total_amount_micros\x18\n \x01(\x03\x42\x03\xe0\x41\x03H\t\x88\x01\x01\x12\x39\n\'regulatory_costs_subtotal_amount_micros\x18\x0b \x01(\x03\x42\x03\xe0\x41\x03H\n\x88\x01\x01\x12\x34\n\"regulatory_costs_tax_amount_micros\x18\x0c \x01(\x03\x42\x03\xe0\x41\x03H\x0b\x88\x01\x01\x12\x36\n$regulatory_costs_total_amount_micros\x18\r \x01(\x03\x42\x03\xe0\x41\x03H\x0c\x88\x01\x01\x12\x36\n$export_charge_subtotal_amount_micros\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03H\r\x88\x01\x01\x12\x31\n\x1f\x65xport_charge_tax_amount_micros\x18\x12 \x01(\x03\x42\x03\xe0\x41\x03H\x0e\x88\x01\x01\x12\x33\n!export_charge_total_amount_micros\x18\x13 \x01(\x03\x42\x03\xe0\x41\x03H\x0f\x88\x01\x01\x12(\n\x16subtotal_amount_micros\x18\x0e \x01(\x03\x42\x03\xe0\x41\x03H\x10\x88\x01\x01\x12#\n\x11tax_amount_micros\x18\x0f \x01(\x03\x42\x03\xe0\x41\x03H\x11\x88\x01\x01\x12%\n\x13total_amount_micros\x18\x10 \x01(\x03\x42\x03\xe0\x41\x03H\x12\x88\x01\x01\x42\x0b\n\t_customerB,\n*_billing_correction_subtotal_amount_microsB\'\n%_billing_correction_tax_amount_microsB)\n\'_billing_correction_total_amount_microsB+\n)_coupon_adjustment_subtotal_amount_microsB&\n$_coupon_adjustment_tax_amount_microsB(\n&_coupon_adjustment_total_amount_microsB2\n0_excess_credit_adjustment_subtotal_amount_microsB-\n+_excess_credit_adjustment_tax_amount_microsB/\n-_excess_credit_adjustment_total_amount_microsB*\n(_regulatory_costs_subtotal_amount_microsB%\n#_regulatory_costs_tax_amount_microsB\'\n%_regulatory_costs_total_amount_microsB\'\n%_export_charge_subtotal_amount_microsB\"\n _export_charge_tax_amount_microsB$\n\"_export_charge_total_amount_microsB\x19\n\x17_subtotal_amount_microsB\x14\n\x12_tax_amount_microsB\x16\n\x14_total_amount_micros\x1a\xe8\x07\n\x14\x41\x63\x63ountBudgetSummary\x12\x1a\n\x08\x63ustomer\x18\n \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12+\n\x19\x63ustomer_descriptive_name\x18\x0b \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12 \n\x0e\x61\x63\x63ount_budget\x18\x0c \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12%\n\x13\x61\x63\x63ount_budget_name\x18\r \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\'\n\x15purchase_order_number\x18\x0e \x01(\tB\x03\xe0\x41\x03H\x04\x88\x01\x01\x12(\n\x16subtotal_amount_micros\x18\x0f \x01(\x03\x42\x03\xe0\x41\x03H\x05\x88\x01\x01\x12#\n\x11tax_amount_micros\x18\x10 \x01(\x03\x42\x03\xe0\x41\x03H\x06\x88\x01\x01\x12%\n\x13total_amount_micros\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03H\x07\x88\x01\x01\x12U\n\x1c\x62illable_activity_date_range\x18\t \x01(\x0b\x32*.google.ads.googleads.v16.common.DateRangeB\x03\xe0\x41\x03\x12&\n\x14served_amount_micros\x18\x12 \x01(\x03\x42\x03\xe0\x41\x03H\x08\x88\x01\x01\x12&\n\x14\x62illed_amount_micros\x18\x13 \x01(\x03\x42\x03\xe0\x41\x03H\t\x88\x01\x01\x12,\n\x1aoverdelivery_amount_micros\x18\x14 \x01(\x03\x42\x03\xe0\x41\x03H\n\x88\x01\x01\x12\x30\n\x1einvalid_activity_amount_micros\x18\x15 \x01(\x03\x42\x03\xe0\x41\x03H\x0b\x88\x01\x01\x12k\n\x1ainvalid_activity_summaries\x18\x16 \x03(\x0b\x32\x42.google.ads.googleads.v16.resources.Invoice.InvalidActivitySummaryB\x03\xe0\x41\x03\x42\x0b\n\t_customerB\x1c\n\x1a_customer_descriptive_nameB\x11\n\x0f_account_budgetB\x16\n\x14_account_budget_nameB\x18\n\x16_purchase_order_numberB\x19\n\x17_subtotal_amount_microsB\x14\n\x12_tax_amount_microsB\x16\n\x14_total_amount_microsB\x17\n\x15_served_amount_microsB\x17\n\x15_billed_amount_microsB\x1d\n\x1b_overdelivery_amount_microsB!\n\x1f_invalid_activity_amount_micros\x1a\x81\x04\n\x16InvalidActivitySummary\x12h\n\x19original_month_of_service\x18\x01 \x01(\x0e\x32;.google.ads.googleads.v16.enums.MonthOfYearEnum.MonthOfYearB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12*\n\x18original_year_of_service\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12%\n\x13original_invoice_id\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12.\n\x1coriginal_account_budget_name\x18\x04 \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x30\n\x1eoriginal_purchase_order_number\x18\x05 \x01(\tB\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\x1f\n\ramount_micros\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03H\x05\x88\x01\x01\x42\x1c\n\x1a_original_month_of_serviceB\x1b\n\x19_original_year_of_serviceB\x16\n\x14_original_invoice_idB\x1f\n\x1d_original_account_budget_nameB!\n\x1f_original_purchase_order_numberB\x10\n\x0e_amount_micros:T\xea\x41Q\n googleads.googleapis.com/Invoice\x12-customers/{customer_id}/invoices/{invoice_id}B\x05\n\x03_idB\x10\n\x0e_billing_setupB\x16\n\x14_payments_account_idB\x16\n\x14_payments_profile_idB\r\n\x0b_issue_dateB\x0b\n\t_due_dateB\x10\n\x0e_currency_codeB\'\n%_export_charge_subtotal_amount_microsB\"\n _export_charge_tax_amount_microsB$\n\"_export_charge_total_amount_microsB\x19\n\x17_subtotal_amount_microsB\x14\n\x12_tax_amount_microsB\x16\n\x14_total_amount_microsB\x14\n\x12_corrected_invoiceB\n\n\x08_pdf_urlB\xfe\x01\n&com.google.ads.googleads.v16.resourcesB\x0cInvoiceProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.DateRange", "google/ads/googleads/v16/common/dates.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + Invoice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Invoice").msgclass + Invoice::AccountSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Invoice.AccountSummary").msgclass + Invoice::AccountBudgetSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Invoice.AccountBudgetSummary").msgclass + Invoice::InvalidActivitySummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Invoice.InvalidActivitySummary").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/keyword_plan_ad_group_keyword_pb.rb b/lib/google/ads/google_ads/v16/resources/keyword_plan_ad_group_keyword_pb.rb new file mode 100644 index 000000000..7780c1364 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/keyword_plan_ad_group_keyword_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/keyword_plan_ad_group_keyword.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/keyword_match_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/resources/keyword_plan_ad_group_keyword.proto\x12\"google.ads.googleads.v16.resources\x1a\x37google/ads/googleads/v16/enums/keyword_match_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdd\x04\n\x19KeywordPlanAdGroupKeyword\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xe0\x41\x05\xfa\x41\x34\n2googleads.googleapis.com/KeywordPlanAdGroupKeyword\x12T\n\x15keyword_plan_ad_group\x18\x08 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/KeywordPlanAdGroupH\x00\x88\x01\x01\x12\x14\n\x02id\x18\t \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x11\n\x04text\x18\n \x01(\tH\x02\x88\x01\x01\x12Y\n\nmatch_type\x18\x05 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.KeywordMatchTypeEnum.KeywordMatchType\x12\x1b\n\x0e\x63pc_bid_micros\x18\x0b \x01(\x03H\x03\x88\x01\x01\x12\x1a\n\x08negative\x18\x0c \x01(\x08\x42\x03\xe0\x41\x05H\x04\x88\x01\x01:\x8f\x01\xea\x41\x8b\x01\n2googleads.googleapis.com/KeywordPlanAdGroupKeyword\x12Ucustomers/{customer_id}/keywordPlanAdGroupKeywords/{keyword_plan_ad_group_keyword_id}B\x18\n\x16_keyword_plan_ad_groupB\x05\n\x03_idB\x07\n\x05_textB\x11\n\x0f_cpc_bid_microsB\x0b\n\t_negativeB\x90\x02\n&com.google.ads.googleads.v16.resourcesB\x1eKeywordPlanAdGroupKeywordProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + KeywordPlanAdGroupKeyword = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordPlanAdGroupKeyword").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/keyword_plan_ad_group_pb.rb b/lib/google/ads/google_ads/v16/resources/keyword_plan_ad_group_pb.rb new file mode 100644 index 000000000..00b8c7dc3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/keyword_plan_ad_group_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/keyword_plan_ad_group.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/resources/keyword_plan_ad_group.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb4\x03\n\x12KeywordPlanAdGroup\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x05\xfa\x41-\n+googleads.googleapis.com/KeywordPlanAdGroup\x12U\n\x15keyword_plan_campaign\x18\x06 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/KeywordPlanCampaignH\x00\x88\x01\x01\x12\x14\n\x02id\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x11\n\x04name\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x1b\n\x0e\x63pc_bid_micros\x18\t \x01(\x03H\x03\x88\x01\x01:x\xea\x41u\n+googleads.googleapis.com/KeywordPlanAdGroup\x12\x46\x63ustomers/{customer_id}/keywordPlanAdGroups/{keyword_plan_ad_group_id}B\x18\n\x16_keyword_plan_campaignB\x05\n\x03_idB\x07\n\x05_nameB\x11\n\x0f_cpc_bid_microsB\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17KeywordPlanAdGroupProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + KeywordPlanAdGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordPlanAdGroup").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/keyword_plan_campaign_keyword_pb.rb b/lib/google/ads/google_ads/v16/resources/keyword_plan_campaign_keyword_pb.rb new file mode 100644 index 000000000..66ae4409c --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/keyword_plan_campaign_keyword_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/keyword_plan_campaign_keyword.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/keyword_match_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/resources/keyword_plan_campaign_keyword.proto\x12\"google.ads.googleads.v16.resources\x1a\x37google/ads/googleads/v16/enums/keyword_match_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb2\x04\n\x1aKeywordPlanCampaignKeyword\x12R\n\rresource_name\x18\x01 \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3googleads.googleapis.com/KeywordPlanCampaignKeyword\x12U\n\x15keyword_plan_campaign\x18\x08 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/KeywordPlanCampaignH\x00\x88\x01\x01\x12\x14\n\x02id\x18\t \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x11\n\x04text\x18\n \x01(\tH\x02\x88\x01\x01\x12Y\n\nmatch_type\x18\x05 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.KeywordMatchTypeEnum.KeywordMatchType\x12\x1a\n\x08negative\x18\x0b \x01(\x08\x42\x03\xe0\x41\x05H\x03\x88\x01\x01:\x91\x01\xea\x41\x8d\x01\n3googleads.googleapis.com/KeywordPlanCampaignKeyword\x12Vcustomers/{customer_id}/keywordPlanCampaignKeywords/{keyword_plan_campaign_keyword_id}B\x18\n\x16_keyword_plan_campaignB\x05\n\x03_idB\x07\n\x05_textB\x0b\n\t_negativeB\x91\x02\n&com.google.ads.googleads.v16.resourcesB\x1fKeywordPlanCampaignKeywordProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + KeywordPlanCampaignKeyword = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordPlanCampaignKeyword").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/keyword_plan_campaign_pb.rb b/lib/google/ads/google_ads/v16/resources/keyword_plan_campaign_pb.rb new file mode 100644 index 000000000..8e2c80039 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/keyword_plan_campaign_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/keyword_plan_campaign.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/keyword_plan_network_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/resources/keyword_plan_campaign.proto\x12\"google.ads.googleads.v16.resources\x1a\x39google/ads/googleads/v16/enums/keyword_plan_network.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa2\x05\n\x13KeywordPlanCampaign\x12K\n\rresource_name\x18\x01 \x01(\tB4\xe0\x41\x05\xfa\x41.\n,googleads.googleapis.com/KeywordPlanCampaign\x12\x44\n\x0ckeyword_plan\x18\t \x01(\tB)\xfa\x41&\n$googleads.googleapis.com/KeywordPlanH\x00\x88\x01\x01\x12\x14\n\x02id\x18\n \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x11\n\x04name\x18\x0b \x01(\tH\x02\x88\x01\x01\x12J\n\x12language_constants\x18\x0c \x03(\tB.\xfa\x41+\n)googleads.googleapis.com/LanguageConstant\x12g\n\x14keyword_plan_network\x18\x06 \x01(\x0e\x32I.google.ads.googleads.v16.enums.KeywordPlanNetworkEnum.KeywordPlanNetwork\x12\x1b\n\x0e\x63pc_bid_micros\x18\r \x01(\x03H\x03\x88\x01\x01\x12M\n\x0bgeo_targets\x18\x08 \x03(\x0b\x32\x38.google.ads.googleads.v16.resources.KeywordPlanGeoTarget:z\xea\x41w\n,googleads.googleapis.com/KeywordPlanCampaign\x12Gcustomers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}B\x0f\n\r_keyword_planB\x05\n\x03_idB\x07\n\x05_nameB\x11\n\x0f_cpc_bid_micros\"\x81\x01\n\x14KeywordPlanGeoTarget\x12Q\n\x13geo_target_constant\x18\x02 \x01(\tB/\xfa\x41,\n*googleads.googleapis.com/GeoTargetConstantH\x00\x88\x01\x01\x42\x16\n\x14_geo_target_constantB\x8a\x02\n&com.google.ads.googleads.v16.resourcesB\x18KeywordPlanCampaignProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + KeywordPlanCampaign = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordPlanCampaign").msgclass + KeywordPlanGeoTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordPlanGeoTarget").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/keyword_plan_pb.rb b/lib/google/ads/google_ads/v16/resources/keyword_plan_pb.rb new file mode 100644 index 000000000..b93de3b5a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/keyword_plan_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/keyword_plan.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/dates_pb' +require 'google/ads/google_ads/v16/enums/keyword_plan_forecast_interval_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n5google/ads/googleads/v16/resources/keyword_plan.proto\x12\"google.ads.googleads.v16.resources\x1a+google/ads/googleads/v16/common/dates.proto\x1a\x43google/ads/googleads/v16/enums/keyword_plan_forecast_interval.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc6\x02\n\x0bKeywordPlan\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xe0\x41\x05\xfa\x41&\n$googleads.googleapis.com/KeywordPlan\x12\x14\n\x02id\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x11\n\x04name\x18\x06 \x01(\tH\x01\x88\x01\x01\x12V\n\x0f\x66orecast_period\x18\x04 \x01(\x0b\x32=.google.ads.googleads.v16.resources.KeywordPlanForecastPeriod:a\xea\x41^\n$googleads.googleapis.com/KeywordPlan\x12\x36\x63ustomers/{customer_id}/keywordPlans/{keyword_plan_id}B\x05\n\x03_idB\x07\n\x05_name\"\xdf\x01\n\x19KeywordPlanForecastPeriod\x12t\n\rdate_interval\x18\x01 \x01(\x0e\x32[.google.ads.googleads.v16.enums.KeywordPlanForecastIntervalEnum.KeywordPlanForecastIntervalH\x00\x12@\n\ndate_range\x18\x02 \x01(\x0b\x32*.google.ads.googleads.v16.common.DateRangeH\x00\x42\n\n\x08intervalB\x82\x02\n&com.google.ads.googleads.v16.resourcesB\x10KeywordPlanProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.DateRange", "google/ads/googleads/v16/common/dates.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + KeywordPlan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordPlan").msgclass + KeywordPlanForecastPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordPlanForecastPeriod").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/keyword_theme_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/keyword_theme_constant_pb.rb new file mode 100644 index 000000000..d5e43c8d4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/keyword_theme_constant_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/keyword_theme_constant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/resources/keyword_theme_constant.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf4\x02\n\x14KeywordThemeConstant\x12L\n\rresource_name\x18\x01 \x01(\tB5\xe0\x41\x03\xfa\x41/\n-googleads.googleapis.com/KeywordThemeConstant\x12\x1e\n\x0c\x63ountry_code\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1e\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01:y\xea\x41v\n-googleads.googleapis.com/KeywordThemeConstant\x12\x45keywordThemeConstants/{express_category_id}~{express_sub_category_id}B\x0f\n\r_country_codeB\x10\n\x0e_language_codeB\x0f\n\r_display_nameB\x8b\x02\n&com.google.ads.googleads.v16.resourcesB\x19KeywordThemeConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + KeywordThemeConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordThemeConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/keyword_view_pb.rb b/lib/google/ads/google_ads/v16/resources/keyword_view_pb.rb new file mode 100644 index 000000000..e9a5edfa6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/keyword_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/keyword_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n5google/ads/googleads/v16/resources/keyword_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc0\x01\n\x0bKeywordView\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xe0\x41\x03\xfa\x41&\n$googleads.googleapis.com/KeywordView:l\xea\x41i\n$googleads.googleapis.com/KeywordView\x12\x41\x63ustomers/{customer_id}/keywordViews/{ad_group_id}~{criterion_id}B\x82\x02\n&com.google.ads.googleads.v16.resourcesB\x10KeywordViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + KeywordView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.KeywordView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/label_pb.rb b/lib/google/ads/google_ads/v16/resources/label_pb.rb new file mode 100644 index 000000000..1952b10d8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/label_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/label.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/text_label_pb' +require 'google/ads/google_ads/v16/enums/label_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n.google/ads/googleads/v16/resources/label.proto\x12\"google.ads.googleads.v16.resources\x1a\x30google/ads/googleads/v16/common/text_label.proto\x1a\x31google/ads/googleads/v16/enums/label_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe1\x02\n\x05Label\x12=\n\rresource_name\x18\x01 \x01(\tB&\xe0\x41\x05\xfa\x41 \n\x1egoogleads.googleapis.com/Label\x12\x14\n\x02id\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x11\n\x04name\x18\x07 \x01(\tH\x01\x88\x01\x01\x12P\n\x06status\x18\x04 \x01(\x0e\x32;.google.ads.googleads.v16.enums.LabelStatusEnum.LabelStatusB\x03\xe0\x41\x03\x12>\n\ntext_label\x18\x05 \x01(\x0b\x32*.google.ads.googleads.v16.common.TextLabel:N\xea\x41K\n\x1egoogleads.googleapis.com/Label\x12)customers/{customer_id}/labels/{label_id}B\x05\n\x03_idB\x07\n\x05_nameB\xfc\x01\n&com.google.ads.googleads.v16.resourcesB\nLabelProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.TextLabel", "google/ads/googleads/v16/common/text_label.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + Label = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Label").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/landing_page_view_pb.rb b/lib/google/ads/google_ads/v16/resources/landing_page_view_pb.rb new file mode 100644 index 000000000..966c42d05 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/landing_page_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/landing_page_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/resources/landing_page_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x97\x02\n\x0fLandingPageView\x12G\n\rresource_name\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(googleads.googleapis.com/LandingPageView\x12&\n\x14unexpanded_final_url\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01:z\xea\x41w\n(googleads.googleapis.com/LandingPageView\x12Kcustomers/{customer_id}/landingPageViews/{unexpanded_final_url_fingerprint}B\x17\n\x15_unexpanded_final_urlB\x86\x02\n&com.google.ads.googleads.v16.resourcesB\x14LandingPageViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + LandingPageView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LandingPageView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/language_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/language_constant_pb.rb new file mode 100644 index 000000000..7d96b4777 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/language_constant_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/language_constant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/resources/language_constant.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xba\x02\n\x10LanguageConstant\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x03\xfa\x41+\n)googleads.googleapis.com/LanguageConstant\x12\x14\n\x02id\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x16\n\x04\x63ode\x18\x07 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x16\n\x04name\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1c\n\ntargetable\x18\t \x01(\x08\x42\x03\xe0\x41\x03H\x03\x88\x01\x01:P\xea\x41M\n)googleads.googleapis.com/LanguageConstant\x12 languageConstants/{criterion_id}B\x05\n\x03_idB\x07\n\x05_codeB\x07\n\x05_nameB\r\n\x0b_targetableB\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15LanguageConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + LanguageConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LanguageConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/lead_form_submission_data_pb.rb b/lib/google/ads/google_ads/v16/resources/lead_form_submission_data_pb.rb new file mode 100644 index 000000000..908f86622 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/lead_form_submission_data_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/lead_form_submission_data.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/lead_form_field_user_input_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/resources/lead_form_submission_data.proto\x12\"google.ads.googleads.v16.resources\x1a\x44google/ads/googleads/v16/enums/lead_form_field_user_input_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x83\x06\n\x16LeadFormSubmissionData\x12N\n\rresource_name\x18\x01 \x01(\tB7\xe0\x41\x03\xfa\x41\x31\n/googleads.googleapis.com/LeadFormSubmissionData\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x05\x61sset\x18\x03 \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1egoogleads.googleapis.com/Asset\x12;\n\x08\x63\x61mpaign\x18\x04 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Campaign\x12\x65\n\x1blead_form_submission_fields\x18\x05 \x03(\x0b\x32;.google.ads.googleads.v16.resources.LeadFormSubmissionFieldB\x03\xe0\x41\x03\x12r\n\"custom_lead_form_submission_fields\x18\n \x03(\x0b\x32\x41.google.ads.googleads.v16.resources.CustomLeadFormSubmissionFieldB\x03\xe0\x41\x03\x12:\n\x08\x61\x64_group\x18\x06 \x01(\tB(\xe0\x41\x03\xfa\x41\"\n googleads.googleapis.com/AdGroup\x12?\n\x0b\x61\x64_group_ad\x18\x07 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"googleads.googleapis.com/AdGroupAd\x12\x12\n\x05gclid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12!\n\x14submission_date_time\x18\t \x01(\tB\x03\xe0\x41\x03:\x84\x01\xea\x41\x80\x01\n/googleads.googleapis.com/LeadFormSubmissionData\x12Mcustomers/{customer_id}/leadFormSubmissionData/{lead_form_user_submission_id}\"\xa7\x01\n\x17LeadFormSubmissionField\x12r\n\nfield_type\x18\x01 \x01(\x0e\x32Y.google.ads.googleads.v16.enums.LeadFormFieldUserInputTypeEnum.LeadFormFieldUserInputTypeB\x03\xe0\x41\x03\x12\x18\n\x0b\x66ield_value\x18\x02 \x01(\tB\x03\xe0\x41\x03\"U\n\x1d\x43ustomLeadFormSubmissionField\x12\x1a\n\rquestion_text\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x66ield_value\x18\x02 \x01(\tB\x03\xe0\x41\x03\x42\x8d\x02\n&com.google.ads.googleads.v16.resourcesB\x1bLeadFormSubmissionDataProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + LeadFormSubmissionData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LeadFormSubmissionData").msgclass + LeadFormSubmissionField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LeadFormSubmissionField").msgclass + CustomLeadFormSubmissionField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.CustomLeadFormSubmissionField").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/life_event_pb.rb b/lib/google/ads/google_ads/v16/resources/life_event_pb.rb new file mode 100644 index 000000000..178c851f0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/life_event_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/life_event.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criterion_category_availability_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/ads/googleads/v16/resources/life_event.proto\x12\"google.ads.googleads.v16.resources\x1a\x45google/ads/googleads/v16/common/criterion_category_availability.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x86\x03\n\tLifeEvent\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"googleads.googleapis.com/LifeEvent\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12:\n\x06parent\x18\x04 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"googleads.googleapis.com/LifeEvent\x12\x1c\n\x0flaunched_to_all\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12[\n\x0e\x61vailabilities\x18\x06 \x03(\x0b\x32>.google.ads.googleads.v16.common.CriterionCategoryAvailabilityB\x03\xe0\x41\x03:[\xea\x41X\n\"googleads.googleapis.com/LifeEvent\x12\x32\x63ustomers/{customer_id}/lifeEvents/{life_event_id}B\x80\x02\n&com.google.ads.googleads.v16.resourcesB\x0eLifeEventProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CriterionCategoryAvailability", "google/ads/googleads/v16/common/criterion_category_availability.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + LifeEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LifeEvent").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/local_services_employee_pb.rb b/lib/google/ads/google_ads/v16/resources/local_services_employee_pb.rb new file mode 100644 index 000000000..3e7544e55 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/local_services_employee_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/local_services_employee.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/local_services_employee_status_pb' +require 'google/ads/google_ads/v16/enums/local_services_employee_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n@google/ads/googleads/v16/resources/local_services_employee.proto\x12\"google.ads.googleads.v16.resources\x1a\x43google/ads/googleads/v16/enums/local_services_employee_status.proto\x1a\x41google/ads/googleads/v16/enums/local_services_employee_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x98\t\n\x15LocalServicesEmployee\x12M\n\rresource_name\x18\x01 \x01(\tB6\xe0\x41\x05\xfa\x41\x30\n.googleads.googleapis.com/LocalServicesEmployee\x12\x14\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\x12\x63reation_date_time\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12p\n\x06status\x18\x04 \x01(\x0e\x32[.google.ads.googleads.v16.enums.LocalServicesEmployeeStatusEnum.LocalServicesEmployeeStatusB\x03\xe0\x41\x03\x12j\n\x04type\x18\x05 \x01(\x0e\x32W.google.ads.googleads.v16.enums.LocalServicesEmployeeTypeEnum.LocalServicesEmployeeTypeB\x03\xe0\x41\x03\x12U\n\x12university_degrees\x18\x06 \x03(\x0b\x32\x34.google.ads.googleads.v16.resources.UniversityDegreeB\x03\xe0\x41\x03\x12G\n\x0bresidencies\x18\x07 \x03(\x0b\x32-.google.ads.googleads.v16.resources.ResidencyB\x03\xe0\x41\x03\x12H\n\x0b\x66\x65llowships\x18\x08 \x03(\x0b\x32..google.ads.googleads.v16.resources.FellowshipB\x03\xe0\x41\x03\x12\x1b\n\tjob_title\x18\t \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12)\n\x17year_started_practicing\x18\n \x01(\x05\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1d\n\x10languages_spoken\x18\x0b \x03(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x63\x61tegory_ids\x18\x0c \x03(\tB\x03\xe0\x41\x03\x12-\n\x1bnational_provider_id_number\x18\r \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x1f\n\remail_address\x18\x0e \x01(\tB\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\x1c\n\nfirst_name\x18\x0f \x01(\tB\x03\xe0\x41\x03H\x05\x88\x01\x01\x12\x1d\n\x0bmiddle_name\x18\x10 \x01(\tB\x03\xe0\x41\x03H\x06\x88\x01\x01\x12\x1b\n\tlast_name\x18\x11 \x01(\tB\x03\xe0\x41\x03H\x07\x88\x01\x01:u\xea\x41r\n.googleads.googleapis.com/LocalServicesEmployee\x12@customers/{customer_id}/localServicesEmployees/{gls_employee_id}B\x05\n\x03_idB\x0c\n\n_job_titleB\x1a\n\x18_year_started_practicingB\x1e\n\x1c_national_provider_id_numberB\x10\n\x0e_email_addressB\r\n\x0b_first_nameB\x0e\n\x0c_middle_nameB\x0c\n\n_last_name\"\xa7\x01\n\x10UniversityDegree\x12\"\n\x10institution_name\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x06\x64\x65gree\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12!\n\x0fgraduation_year\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x42\x13\n\x11_institution_nameB\t\n\x07_degreeB\x12\n\x10_graduation_year\"{\n\tResidency\x12\"\n\x10institution_name\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12!\n\x0f\x63ompletion_year\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x13\n\x11_institution_nameB\x12\n\x10_completion_year\"|\n\nFellowship\x12\"\n\x10institution_name\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12!\n\x0f\x63ompletion_year\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x13\n\x11_institution_nameB\x12\n\x10_completion_yearB\x8c\x02\n&com.google.ads.googleads.v16.resourcesB\x1aLocalServicesEmployeeProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + LocalServicesEmployee = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LocalServicesEmployee").msgclass + UniversityDegree = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.UniversityDegree").msgclass + Residency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Residency").msgclass + Fellowship = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Fellowship").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/local_services_lead_conversation_pb.rb b/lib/google/ads/google_ads/v16/resources/local_services_lead_conversation_pb.rb new file mode 100644 index 000000000..a9a7d3cfa --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/local_services_lead_conversation_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/local_services_lead_conversation.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/local_services_conversation_type_pb' +require 'google/ads/google_ads/v16/enums/local_services_participant_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nIgoogle/ads/googleads/v16/resources/local_services_lead_conversation.proto\x12\"google.ads.googleads.v16.resources\x1a\x45google/ads/googleads/v16/enums/local_services_conversation_type.proto\x1a\x44google/ads/googleads/v16/enums/local_services_participant_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xce\x06\n\x1dLocalServicesLeadConversation\x12U\n\rresource_name\x18\x01 \x01(\tB>\xe0\x41\x03\xfa\x41\x38\n6googleads.googleapis.com/LocalServicesLeadConversation\x12\x0f\n\x02id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12y\n\x14\x63onversation_channel\x18\x03 \x01(\x0e\x32V.google.ads.googleads.v16.enums.LocalServicesLeadConversationTypeEnum.ConversationTypeB\x03\xe0\x41\x03\x12o\n\x10participant_type\x18\x04 \x01(\x0e\x32P.google.ads.googleads.v16.enums.LocalServicesParticipantTypeEnum.ParticipantTypeB\x03\xe0\x41\x03\x12@\n\x04lead\x18\x05 \x01(\tB2\xe0\x41\x03\xfa\x41,\n*googleads.googleapis.com/LocalServicesLead\x12\x1c\n\x0f\x65vent_date_time\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x12phone_call_details\x18\x07 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.PhoneCallDetailsB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12U\n\x0fmessage_details\x18\x08 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.MessageDetailsB\x03\xe0\x41\x03H\x01\x88\x01\x01:\x9a\x01\xea\x41\x96\x01\n6googleads.googleapis.com/LocalServicesLeadConversation\x12\\customers/{customer_id}/localServicesLeadConversations/{local_services_lead_conversation_id}B\x15\n\x13_phone_call_detailsB\x12\n\x10_message_details\"V\n\x10PhoneCallDetails\x12!\n\x14\x63\x61ll_duration_millis\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1f\n\x12\x63\x61ll_recording_url\x18\x02 \x01(\tB\x03\xe0\x41\x03\"#\n\x0eMessageDetails\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x03\x42\x94\x02\n&com.google.ads.googleads.v16.resourcesB\"LocalServicesLeadConversationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + LocalServicesLeadConversation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LocalServicesLeadConversation").msgclass + PhoneCallDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.PhoneCallDetails").msgclass + MessageDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MessageDetails").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/local_services_lead_pb.rb b/lib/google/ads/google_ads/v16/resources/local_services_lead_pb.rb new file mode 100644 index 000000000..ea8ee6064 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/local_services_lead_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/local_services_lead.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/local_services_lead_status_pb' +require 'google/ads/google_ads/v16/enums/local_services_lead_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n.google.ads.googleads.v16.common.LocalServicesDocumentReadOnlyB\x03\xe0\x41\x03H\x02\x88\x01\x01\x42\x10\n\x0e_amount_microsB\x13\n\x11_rejection_reasonB\x1e\n\x1c_insurance_document_readonly\"\xb1\x04\n\x1bLicenseVerificationArtifact\x12\x1e\n\x0clicense_type\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12 \n\x0elicense_number\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12%\n\x13licensee_first_name\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12$\n\x12licensee_last_name\x18\x04 \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x8f\x01\n\x10rejection_reason\x18\x05 \x01(\x0e\x32k.google.ads.googleads.v16.enums.LocalServicesLicenseRejectionReasonEnum.LocalServicesLicenseRejectionReasonB\x03\xe0\x41\x03H\x04\x88\x01\x01\x12k\n\x19license_document_readonly\x18\x06 \x01(\x0b\x32>.google.ads.googleads.v16.common.LocalServicesDocumentReadOnlyB\x03\xe0\x41\x03H\x05\x88\x01\x01\x42\x0f\n\r_license_typeB\x11\n\x0f_license_numberB\x16\n\x14_licensee_first_nameB\x15\n\x13_licensee_last_nameB\x13\n\x11_rejection_reasonB\x1c\n\x1a_license_document_readonly\"\xb6\x05\n-BusinessRegistrationCheckVerificationArtifact\x12\x94\x01\n\x11registration_type\x18\x03 \x01(\x0e\x32o.google.ads.googleads.v16.enums.LocalServicesBusinessRegistrationTypeEnum.LocalServicesBusinessRegistrationTypeB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1a\n\x08\x63heck_id\x18\x04 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\xb4\x01\n\x10rejection_reason\x18\x05 \x01(\x0e\x32\x8f\x01.google.ads.googleads.v16.enums.LocalServicesBusinessRegistrationCheckRejectionReasonEnum.LocalServicesBusinessRegistrationCheckRejectionReasonB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x62\n\x13registration_number\x18\x01 \x01(\x0b\x32>.google.ads.googleads.v16.resources.BusinessRegistrationNumberB\x03\xe0\x41\x03H\x00\x12\x66\n\x15registration_document\x18\x02 \x01(\x0b\x32@.google.ads.googleads.v16.resources.BusinessRegistrationDocumentB\x03\xe0\x41\x03H\x00\x42\x17\n\x15\x62usiness_registrationB\x14\n\x12_registration_typeB\x0b\n\t_check_idB\x13\n\x11_rejection_reason\"A\n\x1a\x42usinessRegistrationNumber\x12\x18\n\x06number\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\t\n\x07_number\"\x99\x01\n\x1c\x42usinessRegistrationDocument\x12\x63\n\x11\x64ocument_readonly\x18\x01 \x01(\x0b\x32>.google.ads.googleads.v16.common.LocalServicesDocumentReadOnlyB\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x14\n\x12_document_readonlyB\x98\x02\n&com.google.ads.googleads.v16.resourcesB&LocalServicesVerificationArtifactProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.LocalServicesDocumentReadOnly", "google/ads/googleads/v16/common/local_services.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + LocalServicesVerificationArtifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LocalServicesVerificationArtifact").msgclass + BackgroundCheckVerificationArtifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.BackgroundCheckVerificationArtifact").msgclass + InsuranceVerificationArtifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.InsuranceVerificationArtifact").msgclass + LicenseVerificationArtifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LicenseVerificationArtifact").msgclass + BusinessRegistrationCheckVerificationArtifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.BusinessRegistrationCheckVerificationArtifact").msgclass + BusinessRegistrationNumber = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.BusinessRegistrationNumber").msgclass + BusinessRegistrationDocument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.BusinessRegistrationDocument").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/location_view_pb.rb b/lib/google/ads/google_ads/v16/resources/location_view_pb.rb new file mode 100644 index 000000000..53586d2b8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/location_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/location_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n6google/ads/googleads/v16/resources/location_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc4\x01\n\x0cLocationView\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%googleads.googleapis.com/LocationView:n\xea\x41k\n%googleads.googleapis.com/LocationView\x12\x42\x63ustomers/{customer_id}/locationViews/{campaign_id}~{criterion_id}B\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11LocationViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + LocationView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.LocationView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/managed_placement_view_pb.rb b/lib/google/ads/google_ads/v16/resources/managed_placement_view_pb.rb new file mode 100644 index 000000000..8d373a085 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/managed_placement_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/managed_placement_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/resources/managed_placement_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe4\x01\n\x14ManagedPlacementView\x12L\n\rresource_name\x18\x01 \x01(\tB5\xe0\x41\x03\xfa\x41/\n-googleads.googleapis.com/ManagedPlacementView:~\xea\x41{\n-googleads.googleapis.com/ManagedPlacementView\x12Jcustomers/{customer_id}/managedPlacementViews/{ad_group_id}~{criterion_id}B\x8b\x02\n&com.google.ads.googleads.v16.resourcesB\x19ManagedPlacementViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ManagedPlacementView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ManagedPlacementView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/media_file_pb.rb b/lib/google/ads/google_ads/v16/resources/media_file_pb.rb new file mode 100644 index 000000000..98f719f66 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/media_file_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/media_file.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/media_type_pb' +require 'google/ads/google_ads/v16/enums/mime_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/ads/googleads/v16/resources/media_file.proto\x12\"google.ads.googleads.v16.resources\x1a/google/ads/googleads/v16/enums/media_type.proto\x1a.google/ads/googleads/v16/enums/mime_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x89\x06\n\tMediaFile\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xe0\x41\x05\xfa\x41$\n\"googleads.googleapis.com/MediaFile\x12\x14\n\x02id\x18\x0c \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12J\n\x04type\x18\x05 \x01(\x0e\x32\x37.google.ads.googleads.v16.enums.MediaTypeEnum.MediaTypeB\x03\xe0\x41\x05\x12M\n\tmime_type\x18\x06 \x01(\x0e\x32\x35.google.ads.googleads.v16.enums.MimeTypeEnum.MimeTypeB\x03\xe0\x41\x03\x12\x1c\n\nsource_url\x18\r \x01(\tB\x03\xe0\x41\x05H\x02\x88\x01\x01\x12\x16\n\x04name\x18\x0e \x01(\tB\x03\xe0\x41\x05H\x03\x88\x01\x01\x12\x1b\n\tfile_size\x18\x0f \x01(\x03\x42\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\x44\n\x05image\x18\x03 \x01(\x0b\x32..google.ads.googleads.v16.resources.MediaImageB\x03\xe0\x41\x05H\x00\x12L\n\x0cmedia_bundle\x18\x04 \x01(\x0b\x32/.google.ads.googleads.v16.resources.MediaBundleB\x03\xe0\x41\x05H\x00\x12\x44\n\x05\x61udio\x18\n \x01(\x0b\x32..google.ads.googleads.v16.resources.MediaAudioB\x03\xe0\x41\x03H\x00\x12\x44\n\x05video\x18\x0b \x01(\x0b\x32..google.ads.googleads.v16.resources.MediaVideoB\x03\xe0\x41\x05H\x00:[\xea\x41X\n\"googleads.googleapis.com/MediaFile\x12\x32\x63ustomers/{customer_id}/mediaFiles/{media_file_id}B\x0b\n\tmediatypeB\x05\n\x03_idB\r\n\x0b_source_urlB\x07\n\x05_nameB\x0c\n\n_file_size\"\xb1\x01\n\nMediaImage\x12\x16\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x05H\x00\x88\x01\x01\x12%\n\x13\x66ull_size_image_url\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12(\n\x16preview_size_image_url\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x42\x07\n\x05_dataB\x16\n\x14_full_size_image_urlB\x19\n\x17_preview_size_image_url\"M\n\x0bMediaBundle\x12\x16\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x05H\x00\x88\x01\x01\x12\x15\n\x03url\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x07\n\x05_dataB\x06\n\x04_url\"I\n\nMediaAudio\x12$\n\x12\x61\x64_duration_millis\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x15\n\x13_ad_duration_millis\"\xec\x01\n\nMediaVideo\x12$\n\x12\x61\x64_duration_millis\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\"\n\x10youtube_video_id\x18\x06 \x01(\tB\x03\xe0\x41\x05H\x01\x88\x01\x01\x12%\n\x13\x61\x64vertising_id_code\x18\x07 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1b\n\tisci_code\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x42\x15\n\x13_ad_duration_millisB\x13\n\x11_youtube_video_idB\x16\n\x14_advertising_id_codeB\x0c\n\n_isci_codeB\x80\x02\n&com.google.ads.googleads.v16.resourcesB\x0eMediaFileProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + MediaFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MediaFile").msgclass + MediaImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MediaImage").msgclass + MediaBundle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MediaBundle").msgclass + MediaAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MediaAudio").msgclass + MediaVideo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MediaVideo").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/mobile_app_category_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/mobile_app_category_constant_pb.rb new file mode 100644 index 000000000..d7361781d --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/mobile_app_category_constant_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/mobile_app_category_constant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/resources/mobile_app_category_constant.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9a\x02\n\x19MobileAppCategoryConstant\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xe0\x41\x03\xfa\x41\x34\n2googleads.googleapis.com/MobileAppCategoryConstant\x12\x14\n\x02id\x18\x04 \x01(\x05\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x16\n\x04name\x18\x05 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01:l\xea\x41i\n2googleads.googleapis.com/MobileAppCategoryConstant\x12\x33mobileAppCategoryConstants/{mobile_app_category_id}B\x05\n\x03_idB\x07\n\x05_nameB\x90\x02\n&com.google.ads.googleads.v16.resourcesB\x1eMobileAppCategoryConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + MobileAppCategoryConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MobileAppCategoryConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/mobile_device_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/mobile_device_constant_pb.rb new file mode 100644 index 000000000..6f3bd6a1a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/mobile_device_constant_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/mobile_device_constant.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/mobile_device_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/resources/mobile_device_constant.proto\x12\"google.ads.googleads.v16.resources\x1a\x37google/ads/googleads/v16/enums/mobile_device_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd4\x03\n\x14MobileDeviceConstant\x12L\n\rresource_name\x18\x01 \x01(\tB5\xe0\x41\x03\xfa\x41/\n-googleads.googleapis.com/MobileDeviceConstant\x12\x14\n\x02id\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x16\n\x04name\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12#\n\x11manufacturer_name\x18\t \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\'\n\x15operating_system_name\x18\n \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12X\n\x04type\x18\x06 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.MobileDeviceTypeEnum.MobileDeviceTypeB\x03\xe0\x41\x03:X\xea\x41U\n-googleads.googleapis.com/MobileDeviceConstant\x12$mobileDeviceConstants/{criterion_id}B\x05\n\x03_idB\x07\n\x05_nameB\x14\n\x12_manufacturer_nameB\x18\n\x16_operating_system_nameB\x8b\x02\n&com.google.ads.googleads.v16.resourcesB\x19MobileDeviceConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + MobileDeviceConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MobileDeviceConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/offline_conversion_upload_client_summary_pb.rb b/lib/google/ads/google_ads/v16/resources/offline_conversion_upload_client_summary_pb.rb new file mode 100644 index 000000000..562a50ab3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/offline_conversion_upload_client_summary_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/offline_conversion_upload_client_summary.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/offline_conversion_diagnostic_status_enum_pb' +require 'google/ads/google_ads/v16/enums/offline_event_upload_client_enum_pb' +require 'google/ads/google_ads/v16/errors/collection_size_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_adjustment_upload_error_pb' +require 'google/ads/google_ads/v16/errors/conversion_upload_error_pb' +require 'google/ads/google_ads/v16/errors/date_error_pb' +require 'google/ads/google_ads/v16/errors/distinct_error_pb' +require 'google/ads/google_ads/v16/errors/field_error_pb' +require 'google/ads/google_ads/v16/errors/mutate_error_pb' +require 'google/ads/google_ads/v16/errors/not_allowlisted_error_pb' +require 'google/ads/google_ads/v16/errors/string_format_error_pb' +require 'google/ads/google_ads/v16/errors/string_length_error_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nQgoogle/ads/googleads/v16/resources/offline_conversion_upload_client_summary.proto\x12\"google.ads.googleads.v16.resources\x1aNgoogle/ads/googleads/v16/enums/offline_conversion_diagnostic_status_enum.proto\x1a\x45google/ads/googleads/v16/enums/offline_event_upload_client_enum.proto\x1a;google/ads/googleads/v16/errors/collection_size_error.proto\x1aHgoogle/ads/googleads/v16/errors/conversion_adjustment_upload_error.proto\x1a=google/ads/googleads/v16/errors/conversion_upload_error.proto\x1a\x30google/ads/googleads/v16/errors/date_error.proto\x1a\x34google/ads/googleads/v16/errors/distinct_error.proto\x1a\x31google/ads/googleads/v16/errors/field_error.proto\x1a\x32google/ads/googleads/v16/errors/mutate_error.proto\x1a;google/ads/googleads/v16/errors/not_allowlisted_error.proto\x1a\x39google/ads/googleads/v16/errors/string_format_error.proto\x1a\x39google/ads/googleads/v16/errors/string_length_error.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x88\x07\n$OfflineConversionUploadClientSummary\x12\\\n\rresource_name\x18\x01 \x01(\tBE\xe0\x41\x03\xfa\x41?\n=googleads.googleapis.com/OfflineConversionUploadClientSummary\x12j\n\x06\x63lient\x18\x02 \x01(\x0e\x32U.google.ads.googleads.v16.enums.OfflineEventUploadClientEnum.OfflineEventUploadClientB\x03\xe0\x41\x03\x12|\n\x06status\x18\x03 \x01(\x0e\x32g.google.ads.googleads.v16.enums.OfflineConversionDiagnosticStatusEnum.OfflineConversionDiagnosticStatusB\x03\xe0\x41\x03\x12\x1e\n\x11total_event_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12#\n\x16successful_event_count\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0csuccess_rate\x18\x06 \x01(\x01\x42\x03\xe0\x41\x03\x12\"\n\x15last_upload_date_time\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x0f\x64\x61ily_summaries\x18\x08 \x03(\x0b\x32<.google.ads.googleads.v16.resources.OfflineConversionSummaryB\x03\xe0\x41\x03\x12X\n\rjob_summaries\x18\t \x03(\x0b\x32<.google.ads.googleads.v16.resources.OfflineConversionSummaryB\x03\xe0\x41\x03\x12O\n\x06\x61lerts\x18\n \x03(\x0b\x32:.google.ads.googleads.v16.resources.OfflineConversionAlertB\x03\xe0\x41\x03:\x8c\x01\xea\x41\x88\x01\n=googleads.googleapis.com/OfflineConversionUploadClientSummary\x12Gcustomers/{customer_id}/offlineConversionUploadClientSummaries/{client}\"\x98\x01\n\x18OfflineConversionSummary\x12\x1d\n\x10successful_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x66\x61iled_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12\x15\n\x06job_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x12\x1a\n\x0bupload_date\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x00\x42\x0f\n\rdimension_key\"\x87\x01\n\x16OfflineConversionAlert\x12N\n\x05\x65rror\x18\x01 \x01(\x0b\x32:.google.ads.googleads.v16.resources.OfflineConversionErrorB\x03\xe0\x41\x03\x12\x1d\n\x10\x65rror_percentage\x18\x02 \x01(\x01\x42\x03\xe0\x41\x03\"\xe7\x08\n\x16OfflineConversionError\x12r\n\x15\x63ollection_size_error\x18\x01 \x01(\x0e\x32L.google.ads.googleads.v16.errors.CollectionSizeErrorEnum.CollectionSizeErrorB\x03\xe0\x41\x03H\x00\x12\x97\x01\n\"conversion_adjustment_upload_error\x18\x02 \x01(\x0e\x32\x64.google.ads.googleads.v16.errors.ConversionAdjustmentUploadErrorEnum.ConversionAdjustmentUploadErrorB\x03\xe0\x41\x03H\x00\x12x\n\x17\x63onversion_upload_error\x18\x03 \x01(\x0e\x32P.google.ads.googleads.v16.errors.ConversionUploadErrorEnum.ConversionUploadErrorB\x03\xe0\x41\x03H\x00\x12S\n\ndate_error\x18\x04 \x01(\x0e\x32\x38.google.ads.googleads.v16.errors.DateErrorEnum.DateErrorB\x03\xe0\x41\x03H\x00\x12_\n\x0e\x64istinct_error\x18\x05 \x01(\x0e\x32@.google.ads.googleads.v16.errors.DistinctErrorEnum.DistinctErrorB\x03\xe0\x41\x03H\x00\x12V\n\x0b\x66ield_error\x18\x06 \x01(\x0e\x32:.google.ads.googleads.v16.errors.FieldErrorEnum.FieldErrorB\x03\xe0\x41\x03H\x00\x12Y\n\x0cmutate_error\x18\x07 \x01(\x0e\x32<.google.ads.googleads.v16.errors.MutateErrorEnum.MutateErrorB\x03\xe0\x41\x03H\x00\x12r\n\x15not_allowlisted_error\x18\x08 \x01(\x0e\x32L.google.ads.googleads.v16.errors.NotAllowlistedErrorEnum.NotAllowlistedErrorB\x03\xe0\x41\x03H\x00\x12l\n\x13string_format_error\x18\t \x01(\x0e\x32H.google.ads.googleads.v16.errors.StringFormatErrorEnum.StringFormatErrorB\x03\xe0\x41\x03H\x00\x12l\n\x13string_length_error\x18\n \x01(\x0e\x32H.google.ads.googleads.v16.errors.StringLengthErrorEnum.StringLengthErrorB\x03\xe0\x41\x03H\x00\x42\x0c\n\nerror_codeB\x9b\x02\n&com.google.ads.googleads.v16.resourcesB)OfflineConversionUploadClientSummaryProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + OfflineConversionUploadClientSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.OfflineConversionUploadClientSummary").msgclass + OfflineConversionSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.OfflineConversionSummary").msgclass + OfflineConversionAlert = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.OfflineConversionAlert").msgclass + OfflineConversionError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.OfflineConversionError").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/offline_user_data_job_pb.rb b/lib/google/ads/google_ads/v16/resources/offline_user_data_job_pb.rb new file mode 100644 index 000000000..11c379d63 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/offline_user_data_job_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/offline_user_data_job.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/offline_user_data_pb' +require 'google/ads/google_ads/v16/enums/offline_user_data_job_failure_reason_pb' +require 'google/ads/google_ads/v16/enums/offline_user_data_job_match_rate_range_pb' +require 'google/ads/google_ads/v16/enums/offline_user_data_job_status_pb' +require 'google/ads/google_ads/v16/enums/offline_user_data_job_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/resources/offline_user_data_job.proto\x12\"google.ads.googleads.v16.resources\x1a\x37google/ads/googleads/v16/common/offline_user_data.proto\x1aIgoogle/ads/googleads/v16/enums/offline_user_data_job_failure_reason.proto\x1aKgoogle/ads/googleads/v16/enums/offline_user_data_job_match_rate_range.proto\x1a\x41google/ads/googleads/v16/enums/offline_user_data_job_status.proto\x1a?google/ads/googleads/v16/enums/offline_user_data_job_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb7\x07\n\x12OfflineUserDataJob\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x05\xfa\x41-\n+googleads.googleapis.com/OfflineUserDataJob\x12\x14\n\x02id\x18\t \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1d\n\x0b\x65xternal_id\x18\n \x01(\x03\x42\x03\xe0\x41\x05H\x02\x88\x01\x01\x12\x64\n\x04type\x18\x04 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.OfflineUserDataJobTypeEnum.OfflineUserDataJobTypeB\x03\xe0\x41\x05\x12j\n\x06status\x18\x05 \x01(\x0e\x32U.google.ads.googleads.v16.enums.OfflineUserDataJobStatusEnum.OfflineUserDataJobStatusB\x03\xe0\x41\x03\x12\x80\x01\n\x0e\x66\x61ilure_reason\x18\x06 \x01(\x0e\x32\x63.google.ads.googleads.v16.enums.OfflineUserDataJobFailureReasonEnum.OfflineUserDataJobFailureReasonB\x03\xe0\x41\x03\x12_\n\x12operation_metadata\x18\x0b \x01(\x0b\x32>.google.ads.googleads.v16.resources.OfflineUserDataJobMetadataB\x03\xe0\x41\x03\x12p\n!customer_match_user_list_metadata\x18\x07 \x01(\x0b\x32>.google.ads.googleads.v16.common.CustomerMatchUserListMetadataB\x03\xe0\x41\x05H\x00\x12X\n\x14store_sales_metadata\x18\x08 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.StoreSalesMetadataB\x03\xe0\x41\x05H\x00:{\xea\x41x\n+googleads.googleapis.com/OfflineUserDataJob\x12Icustomers/{customer_id}/offlineUserDataJobs/{offline_user_data_update_id}B\n\n\x08metadataB\x05\n\x03_idB\x0e\n\x0c_external_id\"\xa3\x01\n\x1aOfflineUserDataJobMetadata\x12\x84\x01\n\x10match_rate_range\x18\x01 \x01(\x0e\x32\x65.google.ads.googleads.v16.enums.OfflineUserDataJobMatchRateRangeEnum.OfflineUserDataJobMatchRateRangeB\x03\xe0\x41\x03\x42\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17OfflineUserDataJobProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CustomerMatchUserListMetadata", "google/ads/googleads/v16/common/offline_user_data.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + OfflineUserDataJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.OfflineUserDataJob").msgclass + OfflineUserDataJobMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.OfflineUserDataJobMetadata").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/operating_system_version_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/operating_system_version_constant_pb.rb new file mode 100644 index 000000000..a717fcee5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/operating_system_version_constant_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/operating_system_version_constant.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/operating_system_version_operator_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nJgoogle/ads/googleads/v16/resources/operating_system_version_constant.proto\x12\"google.ads.googleads.v16.resources\x1aKgoogle/ads/googleads/v16/enums/operating_system_version_operator_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9e\x04\n\x1eOperatingSystemVersionConstant\x12V\n\rresource_name\x18\x01 \x01(\tB?\xe0\x41\x03\xfa\x41\x39\n7googleads.googleapis.com/OperatingSystemVersionConstant\x12\x14\n\x02id\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x16\n\x04name\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\"\n\x10os_major_version\x18\t \x01(\x05\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\"\n\x10os_minor_version\x18\n \x01(\x05\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12\x85\x01\n\roperator_type\x18\x06 \x01(\x0e\x32i.google.ads.googleads.v16.enums.OperatingSystemVersionOperatorTypeEnum.OperatingSystemVersionOperatorTypeB\x03\xe0\x41\x03:l\xea\x41i\n7googleads.googleapis.com/OperatingSystemVersionConstant\x12.operatingSystemVersionConstants/{criterion_id}B\x05\n\x03_idB\x07\n\x05_nameB\x13\n\x11_os_major_versionB\x13\n\x11_os_minor_versionB\x95\x02\n&com.google.ads.googleads.v16.resourcesB#OperatingSystemVersionConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + OperatingSystemVersionConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.OperatingSystemVersionConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/paid_organic_search_term_view_pb.rb b/lib/google/ads/google_ads/v16/resources/paid_organic_search_term_view_pb.rb new file mode 100644 index 000000000..4402a407c --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/paid_organic_search_term_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/paid_organic_search_term_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/resources/paid_organic_search_term_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xbd\x02\n\x19PaidOrganicSearchTermView\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xe0\x41\x03\xfa\x41\x34\n2googleads.googleapis.com/PaidOrganicSearchTermView\x12\x1d\n\x0bsearch_term\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01:\x9d\x01\xea\x41\x99\x01\n2googleads.googleapis.com/PaidOrganicSearchTermView\x12\x63\x63ustomers/{customer_id}/paidOrganicSearchTermViews/{campaign_id}~{ad_group_id}~{base64_search_term}B\x0e\n\x0c_search_termB\x90\x02\n&com.google.ads.googleads.v16.resourcesB\x1ePaidOrganicSearchTermViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + PaidOrganicSearchTermView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.PaidOrganicSearchTermView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/parental_status_view_pb.rb b/lib/google/ads/google_ads/v16/resources/parental_status_view_pb.rb new file mode 100644 index 000000000..d315f467d --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/parental_status_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/parental_status_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/resources/parental_status_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdc\x01\n\x12ParentalStatusView\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x03\xfa\x41-\n+googleads.googleapis.com/ParentalStatusView:z\xea\x41w\n+googleads.googleapis.com/ParentalStatusView\x12Hcustomers/{customer_id}/parentalStatusViews/{ad_group_id}~{criterion_id}B\x89\x02\n&com.google.ads.googleads.v16.resourcesB\x17ParentalStatusViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ParentalStatusView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ParentalStatusView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/payments_account_pb.rb b/lib/google/ads/google_ads/v16/resources/payments_account_pb.rb new file mode 100644 index 000000000..1c29e6744 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/payments_account_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/payments_account.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/resources/payments_account.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdb\x04\n\x0fPaymentsAccount\x12G\n\rresource_name\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(googleads.googleapis.com/PaymentsAccount\x12%\n\x13payments_account_id\x18\x08 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x16\n\x04name\x18\t \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rcurrency_code\x18\n \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12%\n\x13payments_profile_id\x18\x0b \x01(\tB\x03\xe0\x41\x03H\x03\x88\x01\x01\x12/\n\x1dsecondary_payments_profile_id\x18\x0c \x01(\tB\x03\xe0\x41\x03H\x04\x88\x01\x01\x12O\n\x17paying_manager_customer\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/CustomerH\x05\x88\x01\x01:m\xea\x41j\n(googleads.googleapis.com/PaymentsAccount\x12>customers/{customer_id}/paymentsAccounts/{payments_account_id}B\x16\n\x14_payments_account_idB\x07\n\x05_nameB\x10\n\x0e_currency_codeB\x16\n\x14_payments_profile_idB \n\x1e_secondary_payments_profile_idB\x1a\n\x18_paying_manager_customerB\x86\x02\n&com.google.ads.googleads.v16.resourcesB\x14PaymentsAccountProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + PaymentsAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.PaymentsAccount").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/per_store_view_pb.rb b/lib/google/ads/google_ads/v16/resources/per_store_view_pb.rb new file mode 100644 index 000000000..8cba43e42 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/per_store_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/per_store_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n7google/ads/googleads/v16/resources/per_store_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc9\x01\n\x0cPerStoreView\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%googleads.googleapis.com/PerStoreView\x12\x15\n\x08place_id\x18\x02 \x01(\tB\x03\xe0\x41\x03:\\\xea\x41Y\n%googleads.googleapis.com/PerStoreView\x12\x30\x63ustomers/{customer_id}/perStoreViews/{place_id}B\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11PerStoreViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + PerStoreView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.PerStoreView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/product_category_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/product_category_constant_pb.rb new file mode 100644 index 000000000..e72266099 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/product_category_constant_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/product_category_constant.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/product_category_level_pb' +require 'google/ads/google_ads/v16/enums/product_category_state_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/resources/product_category_constant.proto\x12\"google.ads.googleads.v16.resources\x1a;google/ads/googleads/v16/enums/product_category_level.proto\x1a;google/ads/googleads/v16/enums/product_category_state.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd2\x06\n\x17ProductCategoryConstant\x12O\n\rresource_name\x18\x01 \x01(\tB8\xe0\x41\x03\xfa\x41\x32\n0googleads.googleapis.com/ProductCategoryConstant\x12\x18\n\x0b\x63\x61tegory_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12g\n product_category_constant_parent\x18\x03 \x01(\tB8\xe0\x41\x03\xfa\x41\x32\n0googleads.googleapis.com/ProductCategoryConstantH\x00\x88\x01\x01\x12\x61\n\x05level\x18\x04 \x01(\x0e\x32M.google.ads.googleads.v16.enums.ProductCategoryLevelEnum.ProductCategoryLevelB\x03\xe0\x41\x03\x12\x61\n\x05state\x18\x05 \x01(\x0e\x32M.google.ads.googleads.v16.enums.ProductCategoryStateEnum.ProductCategoryStateB\x03\xe0\x41\x03\x12s\n\rlocalizations\x18\x06 \x03(\x0b\x32W.google.ads.googleads.v16.resources.ProductCategoryConstant.ProductCategoryLocalizationB\x03\xe0\x41\x03\x1ag\n\x1bProductCategoryLocalization\x12\x18\n\x0bregion_code\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05value\x18\x03 \x01(\tB\x03\xe0\x41\x03:\x99\x01\xea\x41\x95\x01\n0googleads.googleapis.com/ProductCategoryConstant\x12.productCategoryConstants/{level}~{category_id}*\x18productCategoryConstants2\x17productCategoryConstantB#\n!_product_category_constant_parentB\x8e\x02\n&com.google.ads.googleads.v16.resourcesB\x1cProductCategoryConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ProductCategoryConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ProductCategoryConstant").msgclass + ProductCategoryConstant::ProductCategoryLocalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ProductCategoryConstant.ProductCategoryLocalization").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/product_group_view_pb.rb b/lib/google/ads/google_ads/v16/resources/product_group_view_pb.rb new file mode 100644 index 000000000..1bf3d3144 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/product_group_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/product_group_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/resources/product_group_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd3\x01\n\x10ProductGroupView\x12H\n\rresource_name\x18\x01 \x01(\tB1\xe0\x41\x03\xfa\x41+\n)googleads.googleapis.com/ProductGroupView:u\xea\x41r\n)googleads.googleapis.com/ProductGroupView\x12\x45\x63ustomers/{customer_id}/productGroupViews/{adgroup_id}~{criterion_id}B\x87\x02\n&com.google.ads.googleads.v16.resourcesB\x15ProductGroupViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ProductGroupView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ProductGroupView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/product_link_invitation_pb.rb b/lib/google/ads/google_ads/v16/resources/product_link_invitation_pb.rb new file mode 100644 index 000000000..20fa4f0ae --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/product_link_invitation_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/product_link_invitation.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/linked_product_type_pb' +require 'google/ads/google_ads/v16/enums/product_link_invitation_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n@google/ads/googleads/v16/resources/product_link_invitation.proto\x12\"google.ads.googleads.v16.resources\x1a\x38google/ads/googleads/v16/enums/linked_product_type.proto\x1a\x43google/ads/googleads/v16/enums/product_link_invitation_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb4\x06\n\x15ProductLinkInvitation\x12M\n\rresource_name\x18\x01 \x01(\tB6\xe0\x41\x05\xfa\x41\x30\n.googleads.googleapis.com/ProductLinkInvitation\x12\'\n\x1aproduct_link_invitation_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12p\n\x06status\x18\x03 \x01(\x0e\x32[.google.ads.googleads.v16.enums.ProductLinkInvitationStatusEnum.ProductLinkInvitationStatusB\x03\xe0\x41\x03\x12Z\n\x04type\x18\x06 \x01(\x0e\x32G.google.ads.googleads.v16.enums.LinkedProductTypeEnum.LinkedProductTypeB\x03\xe0\x41\x03\x12\x64\n\x0chotel_center\x18\x04 \x01(\x0b\x32G.google.ads.googleads.v16.resources.HotelCenterLinkInvitationIdentifierB\x03\xe0\x41\x03H\x00\x12j\n\x0fmerchant_center\x18\x05 \x01(\x0b\x32J.google.ads.googleads.v16.resources.MerchantCenterLinkInvitationIdentifierB\x03\xe0\x41\x03H\x00\x12r\n\x13\x61\x64vertising_partner\x18\x07 \x01(\x0b\x32N.google.ads.googleads.v16.resources.AdvertisingPartnerLinkInvitationIdentifierB\x03\xe0\x41\x03H\x00:|\xea\x41y\n.googleads.googleapis.com/ProductLinkInvitation\x12Gcustomers/{customer_id}/productLinkInvitations/{customer_invitation_id}B\x11\n\x0finvited_account\"C\n#HotelCenterLinkInvitationIdentifier\x12\x1c\n\x0fhotel_center_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\"I\n&MerchantCenterLinkInvitationIdentifier\x12\x1f\n\x12merchant_center_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\"{\n*AdvertisingPartnerLinkInvitationIdentifier\x12@\n\x08\x63ustomer\x18\x01 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/CustomerH\x00\x88\x01\x01\x42\x0b\n\t_customerB\x8c\x02\n&com.google.ads.googleads.v16.resourcesB\x1aProductLinkInvitationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ProductLinkInvitation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ProductLinkInvitation").msgclass + HotelCenterLinkInvitationIdentifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.HotelCenterLinkInvitationIdentifier").msgclass + MerchantCenterLinkInvitationIdentifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MerchantCenterLinkInvitationIdentifier").msgclass + AdvertisingPartnerLinkInvitationIdentifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdvertisingPartnerLinkInvitationIdentifier").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/product_link_pb.rb b/lib/google/ads/google_ads/v16/resources/product_link_pb.rb new file mode 100644 index 000000000..5cde74768 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/product_link_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/product_link.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/linked_product_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n5google/ads/googleads/v16/resources/product_link.proto\x12\"google.ads.googleads.v16.resources\x1a\x38google/ads/googleads/v16/enums/linked_product_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xca\x05\n\x0bProductLink\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xe0\x41\x05\xfa\x41&\n$googleads.googleapis.com/ProductLink\x12!\n\x0fproduct_link_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12Z\n\x04type\x18\x03 \x01(\x0e\x32G.google.ads.googleads.v16.enums.LinkedProductTypeEnum.LinkedProductTypeB\x03\xe0\x41\x03\x12V\n\x0c\x64\x61ta_partner\x18\x04 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.DataPartnerIdentifierB\x03\xe0\x41\x05H\x00\x12R\n\ngoogle_ads\x18\x05 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.GoogleAdsIdentifierB\x03\xe0\x41\x05H\x00\x12\\\n\x0fmerchant_center\x18\x0c \x01(\x0b\x32<.google.ads.googleads.v16.resources.MerchantCenterIdentifierB\x03\xe0\x41\x05H\x00\x12\x64\n\x13\x61\x64vertising_partner\x18\r \x01(\x0b\x32@.google.ads.googleads.v16.resources.AdvertisingPartnerIdentifierB\x03\xe0\x41\x03H\x00:a\xea\x41^\n$googleads.googleapis.com/ProductLink\x12\x36\x63ustomers/{customer_id}/productLinks/{product_link_id}B\x10\n\x0elinked_productB\x12\n\x10_product_link_id\"N\n\x15\x44\x61taPartnerIdentifier\x12!\n\x0f\x64\x61ta_partner_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x05H\x00\x88\x01\x01\x42\x12\n\x10_data_partner_id\"d\n\x13GoogleAdsIdentifier\x12@\n\x08\x63ustomer\x18\x01 \x01(\tB)\xe0\x41\x05\xfa\x41#\n!googleads.googleapis.com/CustomerH\x00\x88\x01\x01\x42\x0b\n\t_customer\"W\n\x18MerchantCenterIdentifier\x12$\n\x12merchant_center_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x05H\x00\x88\x01\x01\x42\x15\n\x13_merchant_center_id\"m\n\x1c\x41\x64vertisingPartnerIdentifier\x12@\n\x08\x63ustomer\x18\x01 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/CustomerH\x00\x88\x01\x01\x42\x0b\n\t_customerB\x82\x02\n&com.google.ads.googleads.v16.resourcesB\x10ProductLinkProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ProductLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ProductLink").msgclass + DataPartnerIdentifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.DataPartnerIdentifier").msgclass + GoogleAdsIdentifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.GoogleAdsIdentifier").msgclass + MerchantCenterIdentifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.MerchantCenterIdentifier").msgclass + AdvertisingPartnerIdentifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.AdvertisingPartnerIdentifier").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/qualifying_question_pb.rb b/lib/google/ads/google_ads/v16/resources/qualifying_question_pb.rb new file mode 100644 index 000000000..6756e1b7b --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/qualifying_question_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/qualifying_question.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n \x01(\x0b\x32Y.google.ads.googleads.v16.resources.Recommendation.ForecastingSetTargetRoasRecommendationB\x03\xe0\x41\x03H\x00\x12\x9d\x01\n/maximize_conversion_value_opt_in_recommendation\x18? \x01(\x0b\x32].google.ads.googleads.v16.resources.Recommendation.MaximizeConversionValueOptInRecommendationB\x03\xe0\x41\x03H\x00\x12\x94\x01\n*improve_google_tag_coverage_recommendation\x18@ \x01(\x0b\x32Y.google.ads.googleads.v16.resources.Recommendation.ImproveGoogleTagCoverageRecommendationB\x03\xe0\x41\x03H\x00\x12\x9c\x01\n/performance_max_final_url_opt_in_recommendation\x18\x41 \x01(\x0b\x32\\.google.ads.googleads.v16.resources.Recommendation.PerformanceMaxFinalUrlOptInRecommendationB\x03\xe0\x41\x03H\x00\x12\x94\x01\n*refresh_customer_match_list_recommendation\x18\x42 \x01(\x0b\x32Y.google.ads.googleads.v16.resources.Recommendation.RefreshCustomerMatchListRecommendationB\x03\xe0\x41\x03H\x00\x12\x8a\x01\n%custom_audience_opt_in_recommendation\x18\x43 \x01(\x0b\x32T.google.ads.googleads.v16.resources.Recommendation.CustomAudienceOptInRecommendationB\x03\xe0\x41\x03H\x00\x12}\n\x1elead_form_asset_recommendation\x18\x44 \x01(\x0b\x32N.google.ads.googleads.v16.resources.Recommendation.LeadFormAssetRecommendationB\x03\xe0\x41\x03H\x00\x12\x99\x01\n-improve_demand_gen_ad_strength_recommendation\x18\x45 \x01(\x0b\x32[.google.ads.googleads.v16.resources.Recommendation.ImproveDemandGenAdStrengthRecommendationB\x03\xe0\x41\x03H\x00\x1aM\n\x0cMerchantInfo\x12\x0f\n\x02id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cmulti_client\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xe5\x01\n\x14RecommendationImpact\x12\x63\n\x0c\x62\x61se_metrics\x18\x01 \x01(\x0b\x32H.google.ads.googleads.v16.resources.Recommendation.RecommendationMetricsB\x03\xe0\x41\x03\x12h\n\x11potential_metrics\x18\x02 \x01(\x0b\x32H.google.ads.googleads.v16.resources.Recommendation.RecommendationMetricsB\x03\xe0\x41\x03\x1a\xb3\x02\n\x15RecommendationMetrics\x12\x1d\n\x0bimpressions\x18\x06 \x01(\x01\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x06\x63licks\x18\x07 \x01(\x01\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1d\n\x0b\x63ost_micros\x18\x08 \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1d\n\x0b\x63onversions\x18\t \x01(\x01\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12#\n\x11\x63onversions_value\x18\x0b \x01(\x01\x42\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\x1d\n\x0bvideo_views\x18\n \x01(\x01\x42\x03\xe0\x41\x03H\x05\x88\x01\x01\x42\x0e\n\x0c_impressionsB\t\n\x07_clicksB\x0e\n\x0c_cost_microsB\x0e\n\x0c_conversionsB\x14\n\x12_conversions_valueB\x0e\n\x0c_video_views\x1a\xa0\x04\n\x1c\x43\x61mpaignBudgetRecommendation\x12.\n\x1c\x63urrent_budget_amount_micros\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x32\n recommended_budget_amount_micros\x18\x08 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x8f\x01\n\x0e\x62udget_options\x18\x03 \x03(\x0b\x32r.google.ads.googleads.v16.resources.Recommendation.CampaignBudgetRecommendation.CampaignBudgetRecommendationOptionB\x03\xe0\x41\x03\x1a\xc3\x01\n\"CampaignBudgetRecommendationOption\x12&\n\x14\x62udget_amount_micros\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\\\n\x06impact\x18\x02 \x01(\x0b\x32G.google.ads.googleads.v16.resources.Recommendation.RecommendationImpactB\x03\xe0\x41\x03\x42\x17\n\x15_budget_amount_microsB\x1f\n\x1d_current_budget_amount_microsB#\n!_recommended_budget_amount_micros\x1a\xe5\x02\n\x15KeywordRecommendation\x12\x42\n\x07keyword\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x03\x12n\n\x0csearch_terms\x18\x04 \x03(\x0b\x32S.google.ads.googleads.v16.resources.Recommendation.KeywordRecommendation.SearchTermB\x03\xe0\x41\x03\x12,\n\x1arecommended_cpc_bid_micros\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x1aK\n\nSearchTerm\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12*\n\x1d\x65stimated_weekly_search_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x42\x1d\n\x1b_recommended_cpc_bid_micros\x1a\xb9\x01\n\x14TextAdRecommendation\x12\x37\n\x02\x61\x64\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdB\x03\xe0\x41\x03\x12\x1f\n\rcreation_date\x18\x04 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12!\n\x0f\x61uto_apply_date\x18\x05 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x10\n\x0e_creation_dateB\x12\n\x10_auto_apply_date\x1a\x9b\x05\n\x1cTargetCpaOptInRecommendation\x12\x88\x01\n\x07options\x18\x01 \x03(\x0b\x32r.google.ads.googleads.v16.resources.Recommendation.TargetCpaOptInRecommendation.TargetCpaOptInRecommendationOptionB\x03\xe0\x41\x03\x12/\n\x1drecommended_target_cpa_micros\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x1a\x9c\x03\n\"TargetCpaOptInRecommendationOption\x12x\n\x04goal\x18\x01 \x01(\x0e\x32\x65.google.ads.googleads.v16.enums.TargetCpaOptInRecommendationGoalEnum.TargetCpaOptInRecommendationGoalB\x03\xe0\x41\x03\x12#\n\x11target_cpa_micros\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x38\n&required_campaign_budget_amount_micros\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\\\n\x06impact\x18\x04 \x01(\x0b\x32G.google.ads.googleads.v16.resources.Recommendation.RecommendationImpactB\x03\xe0\x41\x03\x42\x14\n\x12_target_cpa_microsB)\n\'_required_campaign_budget_amount_microsB \n\x1e_recommended_target_cpa_micros\x1a\x81\x01\n&MaximizeConversionsOptInRecommendation\x12\x32\n recommended_budget_amount_micros\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42#\n!_recommended_budget_amount_micros\x1a \n\x1e\x45nhancedCpcOptInRecommendation\x1a#\n!SearchPartnersOptInRecommendation\x1a|\n!MaximizeClicksOptInRecommendation\x12\x32\n recommended_budget_amount_micros\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42#\n!_recommended_budget_amount_micros\x1a\"\n OptimizeAdRotationRecommendation\x1a\xd6\x01\n\x1a\x43\x61lloutAssetRecommendation\x12[\n#recommended_campaign_callout_assets\x18\x01 \x03(\x0b\x32).google.ads.googleads.v16.resources.AssetB\x03\xe0\x41\x03\x12[\n#recommended_customer_callout_assets\x18\x02 \x03(\x0b\x32).google.ads.googleads.v16.resources.AssetB\x03\xe0\x41\x03\x1a\xd9\x01\n\x1bSitelinkAssetRecommendation\x12\\\n$recommended_campaign_sitelink_assets\x18\x01 \x03(\x0b\x32).google.ads.googleads.v16.resources.AssetB\x03\xe0\x41\x03\x12\\\n$recommended_customer_sitelink_assets\x18\x02 \x03(\x0b\x32).google.ads.googleads.v16.resources.AssetB\x03\xe0\x41\x03\x1a\x19\n\x17\x43\x61llAssetRecommendation\x1a\xd0\x01\n\x1eKeywordMatchTypeRecommendation\x12\x42\n\x07keyword\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x03\x12j\n\x16recommended_match_type\x18\x02 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.KeywordMatchTypeEnum.KeywordMatchTypeB\x03\xe0\x41\x03\x1a\xda\x01\n\x1eMoveUnusedBudgetRecommendation\x12(\n\x16\x65xcess_campaign_budget\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12s\n\x15\x62udget_recommendation\x18\x02 \x01(\x0b\x32O.google.ads.googleads.v16.resources.Recommendation.CampaignBudgetRecommendationB\x03\xe0\x41\x03\x42\x19\n\x17_excess_campaign_budget\x1a\xcb\x01\n\x1dTargetRoasOptInRecommendation\x12)\n\x17recommended_target_roas\x18\x01 \x01(\x01\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x38\n&required_campaign_budget_amount_micros\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x1a\n\x18_recommended_target_roasB)\n\'_required_campaign_budget_amount_micros\x1a\xb1\x01\n%ResponsiveSearchAdAssetRecommendation\x12?\n\ncurrent_ad\x18\x03 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdB\x03\xe0\x41\x03\x12G\n\x12recommended_assets\x18\x02 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdB\x03\xe0\x41\x03\x1a\xb9\x01\n1ResponsiveSearchAdImproveAdStrengthRecommendation\x12?\n\ncurrent_ad\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdB\x03\xe0\x41\x03\x12\x43\n\x0erecommended_ad\x18\x02 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdB\x03\xe0\x41\x03\x1a[\n ResponsiveSearchAdRecommendation\x12\x37\n\x02\x61\x64\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdB\x03\xe0\x41\x03\x1a\x94\x02\n\"UseBroadMatchKeywordRecommendation\x12\x42\n\x07keyword\x18\x01 \x03(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x03\x12%\n\x18suggested_keywords_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12$\n\x17\x63\x61mpaign_keywords_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12(\n\x1b\x63\x61mpaign_uses_shared_budget\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12\x33\n&required_campaign_budget_amount_micros\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x1aw\n:UpgradeSmartShoppingCampaignToPerformanceMaxRecommendation\x12\x18\n\x0bmerchant_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1f\n\x12sales_country_code\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\xc5\x01\n%RaiseTargetCpaBidTooLowRecommendation\x12/\n\x1drecommended_target_multiplier\x18\x01 \x01(\x01\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12+\n\x19\x61verage_target_cpa_micros\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42 \n\x1e_recommended_target_multiplierB\x1c\n\x1a_average_target_cpa_micros\x1a%\n#DisplayExpansionOptInRecommendation\x1a\x34\n2UpgradeLocalCampaignToPerformanceMaxRecommendation\x1a\xaf\x01\n&ForecastingSetTargetRoasRecommendation\x12$\n\x17recommended_target_roas\x18\x01 \x01(\x01\x42\x03\xe0\x41\x03\x12_\n\x0f\x63\x61mpaign_budget\x18\x02 \x01(\x0b\x32\x41.google.ads.googleads.v16.resources.Recommendation.CampaignBudgetB\x03\xe0\x41\x03\x1a\xd5\x01\n$ShoppingOfferAttributeRecommendation\x12V\n\x08merchant\x18\x01 \x01(\x0b\x32?.google.ads.googleads.v16.resources.Recommendation.MerchantInfoB\x03\xe0\x41\x03\x12\x17\n\nfeed_label\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0coffers_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12!\n\x14\x64\x65moted_offers_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x1a\xe5\x01\n,ShoppingFixDisapprovedProductsRecommendation\x12V\n\x08merchant\x18\x01 \x01(\x0b\x32?.google.ads.googleads.v16.resources.Recommendation.MerchantInfoB\x03\xe0\x41\x03\x12\x17\n\nfeed_label\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0eproducts_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\'\n\x1a\x64isapproved_products_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x1a\xbe\x01\n%ShoppingTargetAllOffersRecommendation\x12V\n\x08merchant\x18\x01 \x01(\x0b\x32?.google.ads.googleads.v16.resources.Recommendation.MerchantInfoB\x03\xe0\x41\x03\x12$\n\x17untargeted_offers_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x17\n\nfeed_label\x18\x03 \x01(\tB\x03\xe0\x41\x03\x1a\x8b\x02\n+ShoppingAddProductsToCampaignRecommendation\x12V\n\x08merchant\x18\x01 \x01(\x0b\x32?.google.ads.googleads.v16.resources.Recommendation.MerchantInfoB\x03\xe0\x41\x03\x12\x17\n\nfeed_label\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12k\n\x06reason\x18\x03 \x01(\x0e\x32V.google.ads.googleads.v16.enums.ShoppingAddProductsToCampaignRecommendationEnum.ReasonB\x03\xe0\x41\x03\x1a\xa8\x01\n5ShoppingMerchantCenterAccountSuspensionRecommendation\x12V\n\x08merchant\x18\x01 \x01(\x0b\x32?.google.ads.googleads.v16.resources.Recommendation.MerchantInfoB\x03\xe0\x41\x03\x12\x17\n\nfeed_label\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\xbd\x01\nJShoppingMigrateRegularShoppingCampaignOffersToPerformanceMaxRecommendation\x12V\n\x08merchant\x18\x01 \x01(\x0b\x32?.google.ads.googleads.v16.resources.Recommendation.MerchantInfoB\x03\xe0\x41\x03\x12\x17\n\nfeed_label\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x9b\x01\n\x14TargetAdjustmentInfo\x12\x1c\n\nshared_set\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12*\n\x1drecommended_target_multiplier\x18\x02 \x01(\x01\x42\x03\xe0\x41\x03\x12*\n\x1d\x63urrent_average_target_micros\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x42\r\n\x0b_shared_set\x1a\x83\x02\n\x1cRaiseTargetCpaRecommendation\x12g\n\x11target_adjustment\x18\x01 \x01(\x0b\x32G.google.ads.googleads.v16.resources.Recommendation.TargetAdjustmentInfoB\x03\xe0\x41\x03\x12\x65\n\x10\x61pp_bidding_goal\x18\x02 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AppBiddingGoalEnum.AppBiddingGoalB\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x13\n\x11_app_bidding_goal\x1a\x88\x01\n\x1dLowerTargetRoasRecommendation\x12g\n\x11target_adjustment\x18\x01 \x01(\x0b\x32G.google.ads.googleads.v16.resources.Recommendation.TargetAdjustmentInfoB\x03\xe0\x41\x03\x1a*\n(DynamicImageExtensionOptInRecommendation\x1a}\n\x0e\x43\x61mpaignBudget\x12\"\n\x15\x63urrent_amount_micros\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12*\n\x1drecommended_new_amount_micros\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1b\n\x0enew_start_date\x18\x03 \x01(\tB\x03\xe0\x41\x03\x1a#\n!PerformanceMaxOptInRecommendation\x1aI\n-ImprovePerformanceMaxAdStrengthRecommendation\x12\x18\n\x0b\x61sset_group\x18\x01 \x01(\tB\x03\xe0\x41\x03\x1aX\n=MigrateDynamicSearchAdsCampaignToPerformanceMaxRecommendation\x12\x17\n\napply_link\x18\x01 \x01(\tB\x03\xe0\x41\x03\x1a\xb4\x01\n%ForecastingSetTargetCpaRecommendation\x12*\n\x1drecommended_target_cpa_micros\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12_\n\x0f\x63\x61mpaign_budget\x18\x02 \x01(\x0b\x32\x41.google.ads.googleads.v16.resources.Recommendation.CampaignBudgetB\x03\xe0\x41\x03\x1a,\n*MaximizeConversionValueOptInRecommendation\x1a(\n&ImproveGoogleTagCoverageRecommendation\x1a+\n)PerformanceMaxFinalUrlOptInRecommendation\x1a\xec\x02\n&RefreshCustomerMatchListRecommendation\x12\x19\n\x0cuser_list_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1b\n\x0euser_list_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12$\n\x17\x64\x61ys_since_last_refresh\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x61\n\x14top_spending_account\x18\x04 \x03(\x0b\x32>.google.ads.googleads.v16.resources.Recommendation.AccountInfoB\x03\xe0\x41\x03\x12%\n\x18targeting_accounts_count\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12Z\n\rowner_account\x18\x06 \x01(\x0b\x32>.google.ads.googleads.v16.resources.Recommendation.AccountInfoB\x03\xe0\x41\x03\x1a\x46\n\x0b\x41\x63\x63ountInfo\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1d\n\x10\x64\x65scriptive_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1ah\n!CustomAudienceOptInRecommendation\x12\x43\n\x08keywords\x18\x01 \x03(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x03\x1a\x1d\n\x1bLeadFormAssetRecommendation\x1a\xbc\x01\n(ImproveDemandGenAdStrengthRecommendation\x12\x0f\n\x02\x61\x64\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12S\n\x0b\x61\x64_strength\x18\x02 \x01(\x0e\x32\x39.google.ads.googleads.v16.enums.AdStrengthEnum.AdStrengthB\x03\xe0\x41\x03\x12*\n\x1d\x64\x65mand_gen_asset_action_items\x18\x03 \x03(\tB\x03\xe0\x41\x03:i\xea\x41\x66\n\'googleads.googleapis.com/Recommendation\x12;customers/{customer_id}/recommendations/{recommendation_id}B\x10\n\x0erecommendationB\x12\n\x10_campaign_budgetB\x0b\n\t_campaignB\x0b\n\t_ad_groupB\x0c\n\n_dismissedB\x85\x02\n&com.google.ads.googleads.v16.resourcesB\x13RecommendationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.KeywordInfo", "google/ads/googleads/v16/common/criteria.proto"], + ["google.ads.googleads.v16.resources.Ad", "google/ads/googleads/v16/resources/ad.proto"], + ["google.ads.googleads.v16.resources.Asset", "google/ads/googleads/v16/resources/asset.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + Recommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation").msgclass + Recommendation::MerchantInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.MerchantInfo").msgclass + Recommendation::RecommendationImpact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.RecommendationImpact").msgclass + Recommendation::RecommendationMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.RecommendationMetrics").msgclass + Recommendation::CampaignBudgetRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.CampaignBudgetRecommendation").msgclass + Recommendation::CampaignBudgetRecommendation::CampaignBudgetRecommendationOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.CampaignBudgetRecommendation.CampaignBudgetRecommendationOption").msgclass + Recommendation::KeywordRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.KeywordRecommendation").msgclass + Recommendation::KeywordRecommendation::SearchTerm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.KeywordRecommendation.SearchTerm").msgclass + Recommendation::TextAdRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.TextAdRecommendation").msgclass + Recommendation::TargetCpaOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.TargetCpaOptInRecommendation").msgclass + Recommendation::TargetCpaOptInRecommendation::TargetCpaOptInRecommendationOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.TargetCpaOptInRecommendation.TargetCpaOptInRecommendationOption").msgclass + Recommendation::MaximizeConversionsOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.MaximizeConversionsOptInRecommendation").msgclass + Recommendation::EnhancedCpcOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.EnhancedCpcOptInRecommendation").msgclass + Recommendation::SearchPartnersOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.SearchPartnersOptInRecommendation").msgclass + Recommendation::MaximizeClicksOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.MaximizeClicksOptInRecommendation").msgclass + Recommendation::OptimizeAdRotationRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.OptimizeAdRotationRecommendation").msgclass + Recommendation::CalloutAssetRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.CalloutAssetRecommendation").msgclass + Recommendation::SitelinkAssetRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.SitelinkAssetRecommendation").msgclass + Recommendation::CallAssetRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.CallAssetRecommendation").msgclass + Recommendation::KeywordMatchTypeRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.KeywordMatchTypeRecommendation").msgclass + Recommendation::MoveUnusedBudgetRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.MoveUnusedBudgetRecommendation").msgclass + Recommendation::TargetRoasOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.TargetRoasOptInRecommendation").msgclass + Recommendation::ResponsiveSearchAdAssetRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ResponsiveSearchAdAssetRecommendation").msgclass + Recommendation::ResponsiveSearchAdImproveAdStrengthRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ResponsiveSearchAdImproveAdStrengthRecommendation").msgclass + Recommendation::ResponsiveSearchAdRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ResponsiveSearchAdRecommendation").msgclass + Recommendation::UseBroadMatchKeywordRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.UseBroadMatchKeywordRecommendation").msgclass + Recommendation::UpgradeSmartShoppingCampaignToPerformanceMaxRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.UpgradeSmartShoppingCampaignToPerformanceMaxRecommendation").msgclass + Recommendation::RaiseTargetCpaBidTooLowRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.RaiseTargetCpaBidTooLowRecommendation").msgclass + Recommendation::DisplayExpansionOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.DisplayExpansionOptInRecommendation").msgclass + Recommendation::UpgradeLocalCampaignToPerformanceMaxRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.UpgradeLocalCampaignToPerformanceMaxRecommendation").msgclass + Recommendation::ForecastingSetTargetRoasRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ForecastingSetTargetRoasRecommendation").msgclass + Recommendation::ShoppingOfferAttributeRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ShoppingOfferAttributeRecommendation").msgclass + Recommendation::ShoppingFixDisapprovedProductsRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ShoppingFixDisapprovedProductsRecommendation").msgclass + Recommendation::ShoppingTargetAllOffersRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ShoppingTargetAllOffersRecommendation").msgclass + Recommendation::ShoppingAddProductsToCampaignRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ShoppingAddProductsToCampaignRecommendation").msgclass + Recommendation::ShoppingMerchantCenterAccountSuspensionRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ShoppingMerchantCenterAccountSuspensionRecommendation").msgclass + Recommendation::ShoppingMigrateRegularShoppingCampaignOffersToPerformanceMaxRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ShoppingMigrateRegularShoppingCampaignOffersToPerformanceMaxRecommendation").msgclass + Recommendation::TargetAdjustmentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.TargetAdjustmentInfo").msgclass + Recommendation::RaiseTargetCpaRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.RaiseTargetCpaRecommendation").msgclass + Recommendation::LowerTargetRoasRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.LowerTargetRoasRecommendation").msgclass + Recommendation::DynamicImageExtensionOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.DynamicImageExtensionOptInRecommendation").msgclass + Recommendation::CampaignBudget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.CampaignBudget").msgclass + Recommendation::PerformanceMaxOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.PerformanceMaxOptInRecommendation").msgclass + Recommendation::ImprovePerformanceMaxAdStrengthRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ImprovePerformanceMaxAdStrengthRecommendation").msgclass + Recommendation::MigrateDynamicSearchAdsCampaignToPerformanceMaxRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.MigrateDynamicSearchAdsCampaignToPerformanceMaxRecommendation").msgclass + Recommendation::ForecastingSetTargetCpaRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ForecastingSetTargetCpaRecommendation").msgclass + Recommendation::MaximizeConversionValueOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.MaximizeConversionValueOptInRecommendation").msgclass + Recommendation::ImproveGoogleTagCoverageRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ImproveGoogleTagCoverageRecommendation").msgclass + Recommendation::PerformanceMaxFinalUrlOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.PerformanceMaxFinalUrlOptInRecommendation").msgclass + Recommendation::RefreshCustomerMatchListRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.RefreshCustomerMatchListRecommendation").msgclass + Recommendation::AccountInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.AccountInfo").msgclass + Recommendation::CustomAudienceOptInRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.CustomAudienceOptInRecommendation").msgclass + Recommendation::LeadFormAssetRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.LeadFormAssetRecommendation").msgclass + Recommendation::ImproveDemandGenAdStrengthRecommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.Recommendation.ImproveDemandGenAdStrengthRecommendation").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/recommendation_subscription_pb.rb b/lib/google/ads/google_ads/v16/resources/recommendation_subscription_pb.rb new file mode 100644 index 000000000..3ab94068a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/recommendation_subscription_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/recommendation_subscription.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/recommendation_subscription_status_pb' +require 'google/ads/google_ads/v16/enums/recommendation_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/resources/recommendation_subscription.proto\x12\"google.ads.googleads.v16.resources\x1aGgoogle/ads/googleads/v16/enums/recommendation_subscription_status.proto\x1a\x38google/ads/googleads/v16/enums/recommendation_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd6\x04\n\x1aRecommendationSubscription\x12R\n\rresource_name\x18\x01 \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3googleads.googleapis.com/RecommendationSubscription\x12_\n\x04type\x18\x02 \x01(\x0e\x32I.google.ads.googleads.v16.enums.RecommendationTypeEnum.RecommendationTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12\"\n\x10\x63reate_date_time\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\"\n\x10modify_date_time\x18\x04 \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x7f\n\x06status\x18\x05 \x01(\x0e\x32\x65.google.ads.googleads.v16.enums.RecommendationSubscriptionStatusEnum.RecommendationSubscriptionStatusB\x03\xe0\x41\x02H\x02\x88\x01\x01:\x84\x01\xea\x41\x80\x01\n3googleads.googleapis.com/RecommendationSubscription\x12Icustomers/{customer_id}/recommendationSubscriptions/{recommendation_type}B\x13\n\x11_create_date_timeB\x13\n\x11_modify_date_timeB\t\n\x07_statusB\x91\x02\n&com.google.ads.googleads.v16.resourcesB\x1fRecommendationSubscriptionProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + RecommendationSubscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.RecommendationSubscription").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/remarketing_action_pb.rb b/lib/google/ads/google_ads/v16/resources/remarketing_action_pb.rb new file mode 100644 index 000000000..301f23959 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/remarketing_action_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/remarketing_action.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/tag_snippet_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/resources/remarketing_action.proto\x12\"google.ads.googleads.v16.resources\x1a\x31google/ads/googleads/v16/common/tag_snippet.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd4\x02\n\x11RemarketingAction\x12I\n\rresource_name\x18\x01 \x01(\tB2\xe0\x41\x05\xfa\x41,\n*googleads.googleapis.com/RemarketingAction\x12\x14\n\x02id\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x11\n\x04name\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\x46\n\x0ctag_snippets\x18\x04 \x03(\x0b\x32+.google.ads.googleads.v16.common.TagSnippetB\x03\xe0\x41\x03:s\xea\x41p\n*googleads.googleapis.com/RemarketingAction\x12\x42\x63ustomers/{customer_id}/remarketingActions/{remarketing_action_id}B\x05\n\x03_idB\x07\n\x05_nameB\x88\x02\n&com.google.ads.googleads.v16.resourcesB\x16RemarketingActionProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.TagSnippet", "google/ads/googleads/v16/common/tag_snippet.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + RemarketingAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.RemarketingAction").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/search_term_view_pb.rb b/lib/google/ads/google_ads/v16/resources/search_term_view_pb.rb new file mode 100644 index 000000000..bb32e4e82 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/search_term_view_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/search_term_view.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/search_term_targeting_status_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/resources/search_term_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x41google/ads/googleads/v16/enums/search_term_targeting_status.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xbe\x03\n\x0eSearchTermView\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'googleads.googleapis.com/SearchTermView\x12\x1d\n\x0bsearch_term\x18\x05 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12?\n\x08\x61\x64_group\x18\x06 \x01(\tB(\xe0\x41\x03\xfa\x41\"\n googleads.googleapis.com/AdGroupH\x01\x88\x01\x01\x12l\n\x06status\x18\x04 \x01(\x0e\x32W.google.ads.googleads.v16.enums.SearchTermTargetingStatusEnum.SearchTermTargetingStatusB\x03\xe0\x41\x03:y\xea\x41v\n\'googleads.googleapis.com/SearchTermView\x12Kcustomers/{customer_id}/searchTermViews/{campaign_id}~{ad_group_id}~{query}B\x0e\n\x0c_search_termB\x0b\n\t_ad_groupB\x85\x02\n&com.google.ads.googleads.v16.resourcesB\x13SearchTermViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + SearchTermView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.SearchTermView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/shared_criterion_pb.rb b/lib/google/ads/google_ads/v16/resources/shared_criterion_pb.rb new file mode 100644 index 000000000..9a3ecffe5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/shared_criterion_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/shared_criterion.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/enums/criterion_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/resources/shared_criterion.proto\x12\"google.ads.googleads.v16.resources\x1a.google/ads/googleads/v16/common/criteria.proto\x1a\x33google/ads/googleads/v16/enums/criterion_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe5\x07\n\x0fSharedCriterion\x12G\n\rresource_name\x18\x01 \x01(\tB0\xe0\x41\x05\xfa\x41*\n(googleads.googleapis.com/SharedCriterion\x12\x43\n\nshared_set\x18\n \x01(\tB*\xe0\x41\x05\xfa\x41$\n\"googleads.googleapis.com/SharedSetH\x01\x88\x01\x01\x12\x1e\n\x0c\x63riterion_id\x18\x0b \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12R\n\x04type\x18\x04 \x01(\x0e\x32?.google.ads.googleads.v16.enums.CriterionTypeEnum.CriterionTypeB\x03\xe0\x41\x03\x12\x44\n\x07keyword\x18\x03 \x01(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x05H\x00\x12O\n\ryoutube_video\x18\x05 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.YouTubeVideoInfoB\x03\xe0\x41\x05H\x00\x12S\n\x0fyoutube_channel\x18\x06 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.YouTubeChannelInfoB\x03\xe0\x41\x05H\x00\x12H\n\tplacement\x18\x07 \x01(\x0b\x32..google.ads.googleads.v16.common.PlacementInfoB\x03\xe0\x41\x05H\x00\x12Z\n\x13mobile_app_category\x18\x08 \x01(\x0b\x32\x36.google.ads.googleads.v16.common.MobileAppCategoryInfoB\x03\xe0\x41\x05H\x00\x12Y\n\x12mobile_application\x18\t \x01(\x0b\x32\x36.google.ads.googleads.v16.common.MobileApplicationInfoB\x03\xe0\x41\x05H\x00\x12@\n\x05\x62rand\x18\x0c \x01(\x0b\x32*.google.ads.googleads.v16.common.BrandInfoB\x03\xe0\x41\x05H\x00:t\xea\x41q\n(googleads.googleapis.com/SharedCriterion\x12\x45\x63ustomers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}B\x0b\n\tcriterionB\r\n\x0b_shared_setB\x0f\n\r_criterion_idB\x86\x02\n&com.google.ads.googleads.v16.resourcesB\x14SharedCriterionProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.KeywordInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + SharedCriterion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.SharedCriterion").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/shared_set_pb.rb b/lib/google/ads/google_ads/v16/resources/shared_set_pb.rb new file mode 100644 index 000000000..a07dcc661 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/shared_set_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/shared_set.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/shared_set_status_pb' +require 'google/ads/google_ads/v16/enums/shared_set_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/ads/googleads/v16/resources/shared_set.proto\x12\"google.ads.googleads.v16.resources\x1a\x36google/ads/googleads/v16/enums/shared_set_status.proto\x1a\x34google/ads/googleads/v16/enums/shared_set_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xfa\x03\n\tSharedSet\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xe0\x41\x05\xfa\x41$\n\"googleads.googleapis.com/SharedSet\x12\x14\n\x02id\x18\x08 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12R\n\x04type\x18\x03 \x01(\x0e\x32?.google.ads.googleads.v16.enums.SharedSetTypeEnum.SharedSetTypeB\x03\xe0\x41\x05\x12\x11\n\x04name\x18\t \x01(\tH\x01\x88\x01\x01\x12X\n\x06status\x18\x05 \x01(\x0e\x32\x43.google.ads.googleads.v16.enums.SharedSetStatusEnum.SharedSetStatusB\x03\xe0\x41\x03\x12\x1e\n\x0cmember_count\x18\n \x01(\x03\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12!\n\x0freference_count\x18\x0b \x01(\x03\x42\x03\xe0\x41\x03H\x03\x88\x01\x01:[\xea\x41X\n\"googleads.googleapis.com/SharedSet\x12\x32\x63ustomers/{customer_id}/sharedSets/{shared_set_id}B\x05\n\x03_idB\x07\n\x05_nameB\x0f\n\r_member_countB\x12\n\x10_reference_countB\x80\x02\n&com.google.ads.googleads.v16.resourcesB\x0eSharedSetProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + SharedSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.SharedSet").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/shopping_performance_view_pb.rb b/lib/google/ads/google_ads/v16/resources/shopping_performance_view_pb.rb new file mode 100644 index 000000000..08f83923f --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/shopping_performance_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/shopping_performance_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/resources/shopping_performance_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd2\x01\n\x17ShoppingPerformanceView\x12O\n\rresource_name\x18\x01 \x01(\tB8\xe0\x41\x03\xfa\x41\x32\n0googleads.googleapis.com/ShoppingPerformanceView:f\xea\x41\x63\n0googleads.googleapis.com/ShoppingPerformanceView\x12/customers/{customer_id}/shoppingPerformanceViewB\x8e\x02\n&com.google.ads.googleads.v16.resourcesB\x1cShoppingPerformanceViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ShoppingPerformanceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ShoppingPerformanceView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/smart_campaign_search_term_view_pb.rb b/lib/google/ads/google_ads/v16/resources/smart_campaign_search_term_view_pb.rb new file mode 100644 index 000000000..f798afcec --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/smart_campaign_search_term_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/smart_campaign_search_term_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nHgoogle/ads/googleads/v16/resources/smart_campaign_search_term_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd2\x02\n\x1bSmartCampaignSearchTermView\x12S\n\rresource_name\x18\x01 \x01(\tB<\xe0\x41\x03\xfa\x41\x36\n4googleads.googleapis.com/SmartCampaignSearchTermView\x12\x18\n\x0bsearch_term\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12;\n\x08\x63\x61mpaign\x18\x03 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Campaign:\x86\x01\xea\x41\x82\x01\n4googleads.googleapis.com/SmartCampaignSearchTermView\x12Jcustomers/{customer_id}/smartCampaignSearchTermViews/{campaign_id}~{query}B\x92\x02\n&com.google.ads.googleads.v16.resourcesB SmartCampaignSearchTermViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + SmartCampaignSearchTermView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.SmartCampaignSearchTermView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/smart_campaign_setting_pb.rb b/lib/google/ads/google_ads/v16/resources/smart_campaign_setting_pb.rb new file mode 100644 index 000000000..5140d7a3a --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/smart_campaign_setting_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/smart_campaign_setting.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/resources/smart_campaign_setting.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xd8\x06\n\x14SmartCampaignSetting\x12L\n\rresource_name\x18\x01 \x01(\tB5\xe0\x41\x05\xfa\x41/\n-googleads.googleapis.com/SmartCampaignSetting\x12;\n\x08\x63\x61mpaign\x18\x02 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!googleads.googleapis.com/Campaign\x12Z\n\x0cphone_number\x18\x03 \x01(\x0b\x32\x44.google.ads.googleads.v16.resources.SmartCampaignSetting.PhoneNumber\x12!\n\x19\x61\x64vertising_language_code\x18\x07 \x01(\t\x12\x13\n\tfinal_url\x18\x08 \x01(\tH\x00\x12\x8b\x01\n%ad_optimized_business_profile_setting\x18\t \x01(\x0b\x32Z.google.ads.googleads.v16.resources.SmartCampaignSetting.AdOptimizedBusinessProfileSettingH\x00\x12\x17\n\rbusiness_name\x18\x05 \x01(\tH\x01\x12#\n\x19\x62usiness_profile_location\x18\n \x01(\tH\x01\x1a\x65\n\x0bPhoneNumber\x12\x19\n\x0cphone_number\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x63ountry_code\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x0f\n\r_phone_numberB\x0f\n\r_country_code\x1aY\n!AdOptimizedBusinessProfileSetting\x12\x1e\n\x11include_lead_form\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\x14\n\x12_include_lead_form:o\xea\x41l\n-googleads.googleapis.com/SmartCampaignSetting\x12;customers/{customer_id}/smartCampaignSettings/{campaign_id}B\x0e\n\x0clanding_pageB\x12\n\x10\x62usiness_settingB\x8b\x02\n&com.google.ads.googleads.v16.resourcesB\x19SmartCampaignSettingProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + SmartCampaignSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.SmartCampaignSetting").msgclass + SmartCampaignSetting::PhoneNumber = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.SmartCampaignSetting.PhoneNumber").msgclass + SmartCampaignSetting::AdOptimizedBusinessProfileSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.SmartCampaignSetting.AdOptimizedBusinessProfileSetting").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/third_party_app_analytics_link_pb.rb b/lib/google/ads/google_ads/v16/resources/third_party_app_analytics_link_pb.rb new file mode 100644 index 000000000..d8242e0d0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/third_party_app_analytics_link_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/third_party_app_analytics_link.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/resources/third_party_app_analytics_link.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xae\x02\n\x1aThirdPartyAppAnalyticsLink\x12R\n\rresource_name\x18\x01 \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3googleads.googleapis.com/ThirdPartyAppAnalyticsLink\x12#\n\x11shareable_link_id\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01:\x80\x01\xea\x41}\n3googleads.googleapis.com/ThirdPartyAppAnalyticsLink\x12\x46\x63ustomers/{customer_id}/thirdPartyAppAnalyticsLinks/{customer_link_id}B\x14\n\x12_shareable_link_idB\x91\x02\n&com.google.ads.googleads.v16.resourcesB\x1fThirdPartyAppAnalyticsLinkProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + ThirdPartyAppAnalyticsLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.ThirdPartyAppAnalyticsLink").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/topic_constant_pb.rb b/lib/google/ads/google_ads/v16/resources/topic_constant_pb.rb new file mode 100644 index 000000000..24dac4c56 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/topic_constant_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/topic_constant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n7google/ads/googleads/v16/resources/topic_constant.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xbc\x02\n\rTopicConstant\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xe0\x41\x03\xfa\x41(\n&googleads.googleapis.com/TopicConstant\x12\x14\n\x02id\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12R\n\x15topic_constant_parent\x18\x06 \x01(\tB.\xe0\x41\x03\xfa\x41(\n&googleads.googleapis.com/TopicConstantH\x01\x88\x01\x01\x12\x11\n\x04path\x18\x07 \x03(\tB\x03\xe0\x41\x03:F\xea\x41\x43\n&googleads.googleapis.com/TopicConstant\x12\x19topicConstants/{topic_id}B\x05\n\x03_idB\x18\n\x16_topic_constant_parentB\x84\x02\n&com.google.ads.googleads.v16.resourcesB\x12TopicConstantProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + TopicConstant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.TopicConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/topic_view_pb.rb b/lib/google/ads/google_ads/v16/resources/topic_view_pb.rb new file mode 100644 index 000000000..d144035dd --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/topic_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/topic_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/ads/googleads/v16/resources/topic_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb8\x01\n\tTopicView\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"googleads.googleapis.com/TopicView:h\xea\x41\x65\n\"googleads.googleapis.com/TopicView\x12?customers/{customer_id}/topicViews/{ad_group_id}~{criterion_id}B\x80\x02\n&com.google.ads.googleads.v16.resourcesB\x0eTopicViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + TopicView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.TopicView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/travel_activity_group_view_pb.rb b/lib/google/ads/google_ads/v16/resources/travel_activity_group_view_pb.rb new file mode 100644 index 000000000..feb5a2e93 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/travel_activity_group_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/travel_activity_group_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/resources/travel_activity_group_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf2\x01\n\x17TravelActivityGroupView\x12O\n\rresource_name\x18\x01 \x01(\tB8\xe0\x41\x03\xfa\x41\x32\n0googleads.googleapis.com/TravelActivityGroupView:\x85\x01\xea\x41\x81\x01\n0googleads.googleapis.com/TravelActivityGroupView\x12Mcustomers/{customer_id}/travelActivityGroupViews/{ad_group_id}~{criterion_id}B\x8e\x02\n&com.google.ads.googleads.v16.resourcesB\x1cTravelActivityGroupViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + TravelActivityGroupView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.TravelActivityGroupView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/travel_activity_performance_view_pb.rb b/lib/google/ads/google_ads/v16/resources/travel_activity_performance_view_pb.rb new file mode 100644 index 000000000..e567e51b6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/travel_activity_performance_view_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/travel_activity_performance_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nIgoogle/ads/googleads/v16/resources/travel_activity_performance_view.proto\x12\"google.ads.googleads.v16.resources\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xeb\x01\n\x1dTravelActivityPerformanceView\x12U\n\rresource_name\x18\x01 \x01(\tB>\xe0\x41\x03\xfa\x41\x38\n6googleads.googleapis.com/TravelActivityPerformanceView:s\xea\x41p\n6googleads.googleapis.com/TravelActivityPerformanceView\x12\x36\x63ustomers/{customer_id}/travelActivityPerformanceViewsB\x94\x02\n&com.google.ads.googleads.v16.resourcesB\"TravelActivityPerformanceViewProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + TravelActivityPerformanceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.TravelActivityPerformanceView").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/user_interest_pb.rb b/lib/google/ads/google_ads/v16/resources/user_interest_pb.rb new file mode 100644 index 000000000..43d40daf6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/user_interest_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/user_interest.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criterion_category_availability_pb' +require 'google/ads/google_ads/v16/enums/user_interest_taxonomy_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n6google/ads/googleads/v16/resources/user_interest.proto\x12\"google.ads.googleads.v16.resources\x1a\x45google/ads/googleads/v16/common/criterion_category_availability.proto\x1a@google/ads/googleads/v16/enums/user_interest_taxonomy_type.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x86\x05\n\x0cUserInterest\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%googleads.googleapis.com/UserInterest\x12q\n\rtaxonomy_type\x18\x02 \x01(\x0e\x32U.google.ads.googleads.v16.enums.UserInterestTaxonomyTypeEnum.UserInterestTaxonomyTypeB\x03\xe0\x41\x03\x12\"\n\x10user_interest_id\x18\x08 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x16\n\x04name\x18\t \x01(\tB\x03\xe0\x41\x03H\x01\x88\x01\x01\x12P\n\x14user_interest_parent\x18\n \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%googleads.googleapis.com/UserInterestH\x02\x88\x01\x01\x12!\n\x0flaunched_to_all\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12[\n\x0e\x61vailabilities\x18\x07 \x03(\x0b\x32>.google.ads.googleads.v16.common.CriterionCategoryAvailabilityB\x03\xe0\x41\x03:d\xea\x41\x61\n%googleads.googleapis.com/UserInterest\x12\x38\x63ustomers/{customer_id}/userInterests/{user_interest_id}B\x13\n\x11_user_interest_idB\x07\n\x05_nameB\x17\n\x15_user_interest_parentB\x12\n\x10_launched_to_allB\x83\x02\n&com.google.ads.googleads.v16.resourcesB\x11UserInterestProtoP\x01ZKgoogle.golang.org/genproto/googleapis/ads/googleads/v16/resources;resources\xa2\x02\x03GAA\xaa\x02\"Google.Ads.GoogleAds.V16.Resources\xca\x02\"Google\\Ads\\GoogleAds\\V16\\Resources\xea\x02&Google::Ads::GoogleAds::V16::Resourcesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CriterionCategoryAvailability", "google/ads/googleads/v16/common/criterion_category_availability.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Resources + UserInterest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.resources.UserInterest").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/resources/user_list_pb.rb b/lib/google/ads/google_ads/v16/resources/user_list_pb.rb new file mode 100644 index 000000000..4b70c0e85 --- /dev/null +++ b/lib/google/ads/google_ads/v16/resources/user_list_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/resources/user_list.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/user_lists_pb' +require 'google/ads/google_ads/v16/enums/access_reason_pb' +require 'google/ads/google_ads/v16/enums/user_list_access_status_pb' +require 'google/ads/google_ads/v16/enums/user_list_closing_reason_pb' +require 'google/ads/google_ads/v16/enums/user_list_membership_status_pb' +require 'google/ads/google_ads/v16/enums/user_list_size_range_pb' +require 'google/ads/google_ads/v16/enums/user_list_type_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n2google/ads/googleads/v16/resources/user_list.proto\x12\"google.ads.googleads.v16.resources\x1a\x30google/ads/googleads/v16/common/user_lists.proto\x1a\x32google/ads/googleads/v16/enums/access_reason.proto\x1a grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AccountBudgetProposalService API. + # + # This class represents the configuration for AccountBudgetProposalService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AccountBudgetProposalService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_account_budget_proposal to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AccountBudgetProposalService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_account_budget_proposal.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AccountBudgetProposalService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_account_budget_proposal.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AccountBudgetProposalService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_account_budget_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_account_budget_proposal + + # @private + def initialize parent_rpcs = nil + mutate_account_budget_proposal_config = parent_rpcs.mutate_account_budget_proposal if parent_rpcs.respond_to? :mutate_account_budget_proposal + @mutate_account_budget_proposal = ::Gapic::Config::Method.new mutate_account_budget_proposal_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/account_budget_proposal_service/credentials.rb b/lib/google/ads/google_ads/v16/services/account_budget_proposal_service/credentials.rb new file mode 100644 index 000000000..4c4ef2e33 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/account_budget_proposal_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AccountBudgetProposalService + # Credentials for the AccountBudgetProposalService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/account_budget_proposal_service/paths.rb b/lib/google/ads/google_ads/v16/services/account_budget_proposal_service/paths.rb new file mode 100644 index 000000000..8bee6d65d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/account_budget_proposal_service/paths.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AccountBudgetProposalService + # Path helper methods for the AccountBudgetProposalService API. + module Paths + ## + # Create a fully-qualified AccountBudget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accountBudgets/{account_budget_id}` + # + # @param customer_id [String] + # @param account_budget_id [String] + # + # @return [::String] + def account_budget_path customer_id:, account_budget_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accountBudgets/#{account_budget_id}" + end + + ## + # Create a fully-qualified AccountBudgetProposal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accountBudgetProposals/{account_budget_proposal_id}` + # + # @param customer_id [String] + # @param account_budget_proposal_id [String] + # + # @return [::String] + def account_budget_proposal_path customer_id:, account_budget_proposal_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accountBudgetProposals/#{account_budget_proposal_id}" + end + + ## + # Create a fully-qualified BillingSetup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/billingSetups/{billing_setup_id}` + # + # @param customer_id [String] + # @param billing_setup_id [String] + # + # @return [::String] + def billing_setup_path customer_id:, billing_setup_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/billingSetups/#{billing_setup_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/account_budget_proposal_service_pb.rb b/lib/google/ads/google_ads/v16/services/account_budget_proposal_service_pb.rb new file mode 100644 index 000000000..5f59f57c1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/account_budget_proposal_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/account_budget_proposal_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/account_budget_proposal_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/services/account_budget_proposal_service.proto\x12!google.ads.googleads.v16.services\x1a@google/ads/googleads/v16/resources/account_budget_proposal.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xb0\x01\n\"MutateAccountBudgetProposalRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Y\n\toperation\x18\x02 \x01(\x0b\x32\x41.google.ads.googleads.v16.services.AccountBudgetProposalOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xf2\x01\n\x1e\x41\x63\x63ountBudgetProposalOperation\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12K\n\x06\x63reate\x18\x02 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.AccountBudgetProposalH\x00\x12\x45\n\x06remove\x18\x01 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/AccountBudgetProposalH\x00\x42\x0b\n\toperation\"{\n#MutateAccountBudgetProposalResponse\x12T\n\x06result\x18\x02 \x01(\x0b\x32\x44.google.ads.googleads.v16.services.MutateAccountBudgetProposalResult\"o\n!MutateAccountBudgetProposalResult\x12J\n\rresource_name\x18\x01 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/AccountBudgetProposal2\xf5\x02\n\x1c\x41\x63\x63ountBudgetProposalService\x12\x8d\x02\n\x1bMutateAccountBudgetProposal\x12\x45.google.ads.googleads.v16.services.MutateAccountBudgetProposalRequest\x1a\x46.google.ads.googleads.v16.services.MutateAccountBudgetProposalResponse\"_\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02\x41\" grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Creates or removes an account link. + # From V5, create is not supported through + # AccountLinkService.MutateAccountLink. Use + # AccountLinkService.CreateAccountLink instead. + # + # List of thrown errors: + # [AccountLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_account_link(request, options = nil) + # Pass arguments to `mutate_account_link` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAccountLinkRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAccountLinkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_account_link(customer_id: nil, operation: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_account_link` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer being modified. + # @param operation [::Google::Ads::GoogleAds::V16::Services::AccountLinkOperation, ::Hash] + # Required. The operation to perform on the link. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAccountLinkResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAccountLinkResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AccountLinkService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAccountLinkRequest.new + # + # # Call the mutate_account_link method. + # result = client.mutate_account_link request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAccountLinkResponse. + # p result + # + def mutate_account_link request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAccountLinkRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_account_link.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_account_link.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_account_link.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @account_link_service_stub.call_rpc :mutate_account_link, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AccountLinkService API. + # + # This class represents the configuration for AccountLinkService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AccountLinkService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_account_link to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AccountLinkService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_account_link.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AccountLinkService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_account_link.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AccountLinkService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_account_link` + # @return [::Gapic::Config::Method] + # + attr_reader :create_account_link + ## + # RPC-specific configuration for `mutate_account_link` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_account_link + + # @private + def initialize parent_rpcs = nil + create_account_link_config = parent_rpcs.create_account_link if parent_rpcs.respond_to? :create_account_link + @create_account_link = ::Gapic::Config::Method.new create_account_link_config + mutate_account_link_config = parent_rpcs.mutate_account_link if parent_rpcs.respond_to? :mutate_account_link + @mutate_account_link = ::Gapic::Config::Method.new mutate_account_link_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/account_link_service/credentials.rb b/lib/google/ads/google_ads/v16/services/account_link_service/credentials.rb new file mode 100644 index 000000000..5723b5ef6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/account_link_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AccountLinkService + # Credentials for the AccountLinkService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/account_link_service/paths.rb b/lib/google/ads/google_ads/v16/services/account_link_service/paths.rb new file mode 100644 index 000000000..5c4d60e16 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/account_link_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AccountLinkService + # Path helper methods for the AccountLinkService API. + module Paths + ## + # Create a fully-qualified AccountLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accountLinks/{account_link_id}` + # + # @param customer_id [String] + # @param account_link_id [String] + # + # @return [::String] + def account_link_path customer_id:, account_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accountLinks/#{account_link_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/account_link_service_pb.rb b/lib/google/ads/google_ads/v16/services/account_link_service_pb.rb new file mode 100644 index 000000000..cb28475dd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/account_link_service_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/account_link_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/account_link_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n] + # Required. The list of operations to perform on ad group ad labels. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdLabelsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdLabelsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupAdLabelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdLabelsRequest.new + # + # # Call the mutate_ad_group_ad_labels method. + # result = client.mutate_ad_group_ad_labels request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdLabelsResponse. + # p result + # + def mutate_ad_group_ad_labels request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdLabelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_ad_labels.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_ad_labels.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_ad_labels.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_ad_label_service_stub.call_rpc :mutate_ad_group_ad_labels, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupAdLabelService API. + # + # This class represents the configuration for AdGroupAdLabelService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupAdLabelService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_ad_labels to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupAdLabelService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_ad_labels.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAdLabelService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_ad_labels.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupAdLabelService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_ad_labels` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_ad_labels + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_ad_labels_config = parent_rpcs.mutate_ad_group_ad_labels if parent_rpcs.respond_to? :mutate_ad_group_ad_labels + @mutate_ad_group_ad_labels = ::Gapic::Config::Method.new mutate_ad_group_ad_labels_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service/credentials.rb new file mode 100644 index 000000000..032651562 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAdLabelService + # Credentials for the AdGroupAdLabelService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service/paths.rb new file mode 100644 index 000000000..b41a24771 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service/paths.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAdLabelService + # Path helper methods for the AdGroupAdLabelService API. + module Paths + ## + # Create a fully-qualified AdGroupAd resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAds/{ad_group_id}~{ad_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_group_ad_path customer_id:, ad_group_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAds/#{ad_group_id}~#{ad_id}" + end + + ## + # Create a fully-qualified AdGroupAdLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAdLabels/{ad_group_id}~{ad_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_ad_label_path customer_id:, ad_group_id:, ad_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "ad_id cannot contain /" if ad_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAdLabels/#{ad_group_id}~#{ad_id}~#{label_id}" + end + + ## + # Create a fully-qualified Label resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/labels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/labels/#{label_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service_pb.rb new file mode 100644 index 000000000..b17e4665c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_ad_label_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/ad_group_ad_label_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/services/ad_group_ad_label_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/resources/ad_group_ad_label.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xbd\x01\n\x1cMutateAdGroupAdLabelsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12S\n\noperations\x18\x02 \x03(\x0b\x32:.google.ads.googleads.v16.services.AdGroupAdLabelOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xac\x01\n\x17\x41\x64GroupAdLabelOperation\x12\x44\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.AdGroupAdLabelH\x00\x12>\n\x06remove\x18\x02 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/AdGroupAdLabelH\x00\x42\x0b\n\toperation\"\xa2\x01\n\x1dMutateAdGroupAdLabelsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12N\n\x07results\x18\x02 \x03(\x0b\x32=.google.ads.googleads.v16.services.MutateAdGroupAdLabelResult\"a\n\x1aMutateAdGroupAdLabelResult\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/AdGroupAdLabel2\xd6\x02\n\x15\x41\x64GroupAdLabelService\x12\xf5\x01\n\x15MutateAdGroupAdLabels\x12?.google.ads.googleads.v16.services.MutateAdGroupAdLabelsRequest\x1a@.google.ads.googleads.v16.services.MutateAdGroupAdLabelsResponse\"Y\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}/adGroupAdLabels:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x86\x02\n%com.google.ads.googleads.v16.servicesB\x1a\x41\x64GroupAdLabelServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.AdGroupAdLabel", "google/ads/googleads/v16/resources/ad_group_ad_label.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupAdLabelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAdLabelsRequest").msgclass + AdGroupAdLabelOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupAdLabelOperation").msgclass + MutateAdGroupAdLabelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAdLabelsResponse").msgclass + MutateAdGroupAdLabelResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAdLabelResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service_services_pb.rb new file mode 100644 index 000000000..5813206cd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_label_service_services_pb.rb @@ -0,0 +1,62 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_ad_label_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_ad_label_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAdLabelService + # Proto file describing the Ad Group Ad Label service. + # + # Service to manage labels on ad group ads. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupAdLabelService' + + # Creates and removes ad group ad labels. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [HeaderError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateAdGroupAdLabels, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdLabelsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdLabelsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_service.rb new file mode 100644 index 000000000..0e493486a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_ad_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_ad_service/paths" +require "google/ads/google_ads/v16/services/ad_group_ad_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ads in an ad group. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_ad_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client.new + # + module AdGroupAdService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_ad_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_ad_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_service/client.rb new file mode 100644 index 000000000..73fb403e4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_service/client.rb @@ -0,0 +1,482 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_ad_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAdService + ## + # Client for the AdGroupAdService service. + # + # Service to manage ads in an ad group. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_ad_service_stub + + ## + # Configure the AdGroupAdService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupAdService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupAdService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_ad_service_stub.universe_domain + end + + ## + # Create a new AdGroupAdService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupAdService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_ad_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_ad_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes ads. Operation statuses are returned. + # + # List of thrown errors: + # [AdCustomizerError]() + # [AdError]() + # [AdGroupAdError]() + # [AdSharingError]() + # [AdxError]() + # [AssetError]() + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [ContextError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FeedAttributeReferenceError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [ImageError]() + # [InternalError]() + # [ListOperationError]() + # [MediaBundleError]() + # [MediaFileError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [PolicyFindingError]() + # [PolicyValidationParameterError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # + # @overload mutate_ad_group_ads(request, options = nil) + # Pass arguments to `mutate_ad_group_ads` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_ads(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_group_ads` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ads are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupAdOperation, ::Hash>] + # Required. The list of operations to perform on individual ads. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsRequest.new + # + # # Call the mutate_ad_group_ads method. + # result = client.mutate_ad_group_ads request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsResponse. + # p result + # + def mutate_ad_group_ads request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_ads.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_ads.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_ads.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_ad_service_stub.call_rpc :mutate_ad_group_ads, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupAdService API. + # + # This class represents the configuration for AdGroupAdService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_ads to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_ads.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAdService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_ads.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupAdService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_ads` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_ads + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_ads_config = parent_rpcs.mutate_ad_group_ads if parent_rpcs.respond_to? :mutate_ad_group_ads + @mutate_ad_group_ads = ::Gapic::Config::Method.new mutate_ad_group_ads_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_service/credentials.rb new file mode 100644 index 000000000..d0d6c4943 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAdService + # Credentials for the AdGroupAdService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_service/paths.rb new file mode 100644 index 000000000..ac43a35af --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_service/paths.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAdService + # Path helper methods for the AdGroupAdService API. + module Paths + ## + # Create a fully-qualified Ad resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/ads/{ad_id}` + # + # @param customer_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_path customer_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/ads/#{ad_id}" + end + + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupAd resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAds/{ad_group_id}~{ad_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_group_ad_path customer_id:, ad_group_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAds/#{ad_group_id}~#{ad_id}" + end + + ## + # Create a fully-qualified AdGroupAdLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAdLabels/{ad_group_id}~{ad_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_ad_label_path customer_id:, ad_group_id:, ad_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "ad_id cannot contain /" if ad_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAdLabels/#{ad_group_id}~#{ad_id}~#{label_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_service_pb.rb new file mode 100644 index 000000000..8203b9a26 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_service_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_ad_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/policy_pb' +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_ad_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/services/ad_group_ad_service.proto\x12!google.ads.googleads.v16.services\x1a,google/ads/googleads/v16/common/policy.proto\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x34google/ads/googleads/v16/resources/ad_group_ad.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x9f\x02\n\x17MutateAdGroupAdsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12N\n\noperations\x18\x02 \x03(\x0b\x32\x35.google.ads.googleads.v16.services.AdGroupAdOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xf0\x02\n\x12\x41\x64GroupAdOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12_\n\x1bpolicy_validation_parameter\x18\x05 \x01(\x0b\x32:.google.ads.googleads.v16.common.PolicyValidationParameter\x12?\n\x06\x63reate\x18\x01 \x01(\x0b\x32-.google.ads.googleads.v16.resources.AdGroupAdH\x00\x12?\n\x06update\x18\x02 \x01(\x0b\x32-.google.ads.googleads.v16.resources.AdGroupAdH\x00\x12\x39\n\x06remove\x18\x03 \x01(\tB\'\xfa\x41$\n\"googleads.googleapis.com/AdGroupAdH\x00\x42\x0b\n\toperation\"\x98\x01\n\x18MutateAdGroupAdsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12I\n\x07results\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.MutateAdGroupAdResult\"\x9b\x01\n\x15MutateAdGroupAdResult\x12>\n\rresource_name\x18\x01 \x01(\tB\'\xfa\x41$\n\"googleads.googleapis.com/AdGroupAd\x12\x42\n\x0b\x61\x64_group_ad\x18\x02 \x01(\x0b\x32-.google.ads.googleads.v16.resources.AdGroupAd2\xbd\x02\n\x10\x41\x64GroupAdService\x12\xe1\x01\n\x10MutateAdGroupAds\x12:.google.ads.googleads.v16.services.MutateAdGroupAdsRequest\x1a;.google.ads.googleads.v16.services.MutateAdGroupAdsResponse\"T\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x35\"0/v16/customers/{customer_id=*}/adGroupAds:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x81\x02\n%com.google.ads.googleads.v16.servicesB\x15\x41\x64GroupAdServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.common.PolicyValidationParameter", "google/ads/googleads/v16/common/policy.proto"], + ["google.ads.googleads.v16.resources.AdGroupAd", "google/ads/googleads/v16/resources/ad_group_ad.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupAdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAdsRequest").msgclass + AdGroupAdOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupAdOperation").msgclass + MutateAdGroupAdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAdsResponse").msgclass + MutateAdGroupAdResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAdResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_ad_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_ad_service_services_pb.rb new file mode 100644 index 000000000..dccb10124 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_ad_service_services_pb.rb @@ -0,0 +1,94 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_ad_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_ad_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAdService + # Proto file describing the Ad Group Ad service. + # + # Service to manage ads in an ad group. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupAdService' + + # Creates, updates, or removes ads. Operation statuses are returned. + # + # List of thrown errors: + # [AdCustomizerError]() + # [AdError]() + # [AdGroupAdError]() + # [AdSharingError]() + # [AdxError]() + # [AssetError]() + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [ContextError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FeedAttributeReferenceError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [ImageError]() + # [InternalError]() + # [ListOperationError]() + # [MediaBundleError]() + # [MediaFileError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [PolicyFindingError]() + # [PolicyValidationParameterError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateAdGroupAds, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAdsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_service.rb new file mode 100644 index 000000000..1846d365d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_asset_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_asset_service/paths" +require "google/ads/google_ads/v16/services/ad_group_asset_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ad group assets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_asset_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client.new + # + module AdGroupAssetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_asset_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_asset_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_service/client.rb new file mode 100644 index 000000000..d16411735 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_service/client.rb @@ -0,0 +1,451 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_asset_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAssetService + ## + # Client for the AdGroupAssetService service. + # + # Service to manage ad group assets. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_asset_service_stub + + ## + # Configure the AdGroupAssetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupAssetService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupAssetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_asset_service_stub.universe_domain + end + + ## + # Create a new AdGroupAssetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupAssetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_asset_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_asset_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes ad group assets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NotAllowlistedError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_ad_group_assets(request, options = nil) + # Pass arguments to `mutate_ad_group_assets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_assets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_group_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ad group assets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupAssetOperation, ::Hash>] + # Required. The list of operations to perform on individual ad group assets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsRequest.new + # + # # Call the mutate_ad_group_assets method. + # result = client.mutate_ad_group_assets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsResponse. + # p result + # + def mutate_ad_group_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_assets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_asset_service_stub.call_rpc :mutate_ad_group_assets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupAssetService API. + # + # This class represents the configuration for AdGroupAssetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_assets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_assets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_assets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupAssetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_assets + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_assets_config = parent_rpcs.mutate_ad_group_assets if parent_rpcs.respond_to? :mutate_ad_group_assets + @mutate_ad_group_assets = ::Gapic::Config::Method.new mutate_ad_group_assets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_service/credentials.rb new file mode 100644 index 000000000..f01c4d81a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAssetService + # Credentials for the AdGroupAssetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_service/paths.rb new file mode 100644 index 000000000..63de76546 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_service/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAssetService + # Path helper methods for the AdGroupAssetService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAssets/{ad_group_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def ad_group_asset_path customer_id:, ad_group_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAssets/#{ad_group_id}~#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_service_pb.rb new file mode 100644 index 000000000..340f57172 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_asset_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_asset_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/ad_group_asset_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x37google/ads/googleads/v16/resources/ad_group_asset.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa5\x02\n\x1aMutateAdGroupAssetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Q\n\noperations\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.AdGroupAssetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x9b\x02\n\x15\x41\x64GroupAssetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x42\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.AdGroupAssetH\x00\x12\x42\n\x06update\x18\x03 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.AdGroupAssetH\x00\x12<\n\x06remove\x18\x02 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/AdGroupAssetH\x00\x42\x0b\n\toperation\"\x9e\x01\n\x1bMutateAdGroupAssetsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12L\n\x07results\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.MutateAdGroupAssetResult\"\xa7\x01\n\x18MutateAdGroupAssetResult\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/AdGroupAsset\x12H\n\x0e\x61\x64_group_asset\x18\x02 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.AdGroupAsset2\xcc\x02\n\x13\x41\x64GroupAssetService\x12\xed\x01\n\x13MutateAdGroupAssets\x12=.google.ads.googleads.v16.services.MutateAdGroupAssetsRequest\x1a>.google.ads.googleads.v16.services.MutateAdGroupAssetsResponse\"W\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x38\"3/v16/customers/{customer_id=*}/adGroupAssets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x84\x02\n%com.google.ads.googleads.v16.servicesB\x18\x41\x64GroupAssetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AdGroupAsset", "google/ads/googleads/v16/resources/ad_group_asset.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAssetsRequest").msgclass + AdGroupAssetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupAssetOperation").msgclass + MutateAdGroupAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAssetsResponse").msgclass + MutateAdGroupAssetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAssetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_service_services_pb.rb new file mode 100644 index 000000000..2ec513100 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_service_services_pb.rb @@ -0,0 +1,63 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_asset_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_asset_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAssetService + # Proto file describing the AdGroupAsset service. + # + # Service to manage ad group assets. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupAssetService' + + # Creates, updates, or removes ad group assets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NotAllowlistedError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateAdGroupAssets, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service.rb new file mode 100644 index 000000000..bb83b7bf9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_asset_set_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_asset_set_service/paths" +require "google/ads/google_ads/v16/services/ad_group_asset_set_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ad group asset set + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_asset_set_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client.new + # + module AdGroupAssetSetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_asset_set_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_asset_set_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/client.rb new file mode 100644 index 000000000..b97b7b440 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_asset_set_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAssetSetService + ## + # Client for the AdGroupAssetSetService service. + # + # Service to manage ad group asset set + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_asset_set_service_stub + + ## + # Configure the AdGroupAssetSetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupAssetSetService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupAssetSetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_asset_set_service_stub.universe_domain + end + + ## + # Create a new AdGroupAssetSetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupAssetSetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_asset_set_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_asset_set_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, or removes ad group asset sets. Operation statuses are + # returned. + # + # @overload mutate_ad_group_asset_sets(request, options = nil) + # Pass arguments to `mutate_ad_group_asset_sets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_asset_sets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_group_asset_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ad group asset sets are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetOperation, ::Hash>] + # Required. The list of operations to perform on individual ad group asset + # sets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsRequest.new + # + # # Call the mutate_ad_group_asset_sets method. + # result = client.mutate_ad_group_asset_sets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsResponse. + # p result + # + def mutate_ad_group_asset_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_asset_sets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_asset_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_asset_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_asset_set_service_stub.call_rpc :mutate_ad_group_asset_sets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupAssetSetService API. + # + # This class represents the configuration for AdGroupAssetSetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_asset_sets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_asset_sets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupAssetSetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_asset_sets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupAssetSetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_asset_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_asset_sets + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_asset_sets_config = parent_rpcs.mutate_ad_group_asset_sets if parent_rpcs.respond_to? :mutate_ad_group_asset_sets + @mutate_ad_group_asset_sets = ::Gapic::Config::Method.new mutate_ad_group_asset_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/credentials.rb new file mode 100644 index 000000000..4b1863949 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAssetSetService + # Credentials for the AdGroupAssetSetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/paths.rb new file mode 100644 index 000000000..7f06aa6c3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAssetSetService + # Path helper methods for the AdGroupAssetSetService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupAssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAssetSets/{ad_group_id}~{asset_set_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def ad_group_asset_set_path customer_id:, ad_group_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAssetSets/#{ad_group_id}~#{asset_set_id}" + end + + ## + # Create a fully-qualified AssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSets/#{asset_set_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service_pb.rb new file mode 100644 index 000000000..ed826fb06 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_asset_set_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_asset_set_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/services/ad_group_asset_set_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a;google/ads/googleads/v16/resources/ad_group_asset_set.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xab\x02\n\x1dMutateAdGroupAssetSetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12T\n\noperations\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.AdGroupAssetSetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xaf\x01\n\x18\x41\x64GroupAssetSetOperation\x12\x45\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.AdGroupAssetSetH\x00\x12?\n\x06remove\x18\x02 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/AdGroupAssetSetH\x00\x42\x0b\n\toperation\"\xa4\x01\n\x1eMutateAdGroupAssetSetsResponse\x12O\n\x07results\x18\x01 \x03(\x0b\x32>.google.ads.googleads.v16.services.MutateAdGroupAssetSetResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xb4\x01\n\x1bMutateAdGroupAssetSetResult\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/AdGroupAssetSet\x12O\n\x12\x61\x64_group_asset_set\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.AdGroupAssetSet2\xdb\x02\n\x16\x41\x64GroupAssetSetService\x12\xf9\x01\n\x16MutateAdGroupAssetSets\x12@.google.ads.googleads.v16.services.MutateAdGroupAssetSetsRequest\x1a\x41.google.ads.googleads.v16.services.MutateAdGroupAssetSetsResponse\"Z\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02;\"6/v16/customers/{customer_id=*}/adGroupAssetSets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x87\x02\n%com.google.ads.googleads.v16.servicesB\x1b\x41\x64GroupAssetSetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.AdGroupAssetSet", "google/ads/googleads/v16/resources/ad_group_asset_set.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupAssetSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAssetSetsRequest").msgclass + AdGroupAssetSetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupAssetSetOperation").msgclass + MutateAdGroupAssetSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAssetSetsResponse").msgclass + MutateAdGroupAssetSetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupAssetSetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service_services_pb.rb new file mode 100644 index 000000000..a947b5a81 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_asset_set_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_asset_set_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_asset_set_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupAssetSetService + # Proto file describing the AdGroupAssetSet service. + # + # Service to manage ad group asset set + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupAssetSetService' + + # Creates, or removes ad group asset sets. Operation statuses are + # returned. + rpc :MutateAdGroupAssetSets, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupAssetSetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service.rb new file mode 100644 index 000000000..dec597638 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_bid_modifier_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_bid_modifier_service/paths" +require "google/ads/google_ads/v16/services/ad_group_bid_modifier_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ad group bid modifiers. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_bid_modifier_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client.new + # + module AdGroupBidModifierService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_bid_modifier_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_bid_modifier_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/client.rb new file mode 100644 index 000000000..34375a91e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/client.rb @@ -0,0 +1,465 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_bid_modifier_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupBidModifierService + ## + # Client for the AdGroupBidModifierService service. + # + # Service to manage ad group bid modifiers. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_bid_modifier_service_stub + + ## + # Configure the AdGroupBidModifierService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupBidModifierService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupBidModifierService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_bid_modifier_service_stub.universe_domain + end + + ## + # Create a new AdGroupBidModifierService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupBidModifierService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_bid_modifier_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_bid_modifier_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes ad group bid modifiers. + # Operation statuses are returned. + # + # List of thrown errors: + # [AdGroupBidModifierError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [CriterionError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_ad_group_bid_modifiers(request, options = nil) + # Pass arguments to `mutate_ad_group_bid_modifiers` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_bid_modifiers(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_group_bid_modifiers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. ID of the customer whose ad group bid modifiers are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierOperation, ::Hash>] + # Required. The list of operations to perform on individual ad group bid + # modifiers. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersRequest.new + # + # # Call the mutate_ad_group_bid_modifiers method. + # result = client.mutate_ad_group_bid_modifiers request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersResponse. + # p result + # + def mutate_ad_group_bid_modifiers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_bid_modifiers.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_bid_modifiers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_bid_modifiers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_bid_modifier_service_stub.call_rpc :mutate_ad_group_bid_modifiers, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupBidModifierService API. + # + # This class represents the configuration for AdGroupBidModifierService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_bid_modifiers to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_bid_modifiers.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupBidModifierService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_bid_modifiers.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupBidModifierService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_bid_modifiers` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_bid_modifiers + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_bid_modifiers_config = parent_rpcs.mutate_ad_group_bid_modifiers if parent_rpcs.respond_to? :mutate_ad_group_bid_modifiers + @mutate_ad_group_bid_modifiers = ::Gapic::Config::Method.new mutate_ad_group_bid_modifiers_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/credentials.rb new file mode 100644 index 000000000..2c58a6dd9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupBidModifierService + # Credentials for the AdGroupBidModifierService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/paths.rb new file mode 100644 index 000000000..3054f1c43 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupBidModifierService + # Path helper methods for the AdGroupBidModifierService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupBidModifier resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupBidModifiers/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_bid_modifier_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupBidModifiers/#{ad_group_id}~#{criterion_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service_pb.rb new file mode 100644 index 000000000..66dac0cbf --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_bid_modifier_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_bid_modifier_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/services/ad_group_bid_modifier_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a>google/ads/googleads/v16/resources/ad_group_bid_modifier.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb1\x02\n MutateAdGroupBidModifiersRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12W\n\noperations\x18\x02 \x03(\x0b\x32>.google.ads.googleads.v16.services.AdGroupBidModifierOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xb3\x02\n\x1b\x41\x64GroupBidModifierOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12H\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.AdGroupBidModifierH\x00\x12H\n\x06update\x18\x02 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.AdGroupBidModifierH\x00\x12\x42\n\x06remove\x18\x03 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/AdGroupBidModifierH\x00\x42\x0b\n\toperation\"\xaa\x01\n!MutateAdGroupBidModifiersResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12R\n\x07results\x18\x02 \x03(\x0b\x32\x41.google.ads.googleads.v16.services.MutateAdGroupBidModifierResult\"\xc0\x01\n\x1eMutateAdGroupBidModifierResult\x12G\n\rresource_name\x18\x01 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/AdGroupBidModifier\x12U\n\x15\x61\x64_group_bid_modifier\x18\x02 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.AdGroupBidModifier2\xea\x02\n\x19\x41\x64GroupBidModifierService\x12\x85\x02\n\x19MutateAdGroupBidModifiers\x12\x43.google.ads.googleads.v16.services.MutateAdGroupBidModifiersRequest\x1a\x44.google.ads.googleads.v16.services.MutateAdGroupBidModifiersResponse\"]\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02>\"9/v16/customers/{customer_id=*}/adGroupBidModifiers:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8a\x02\n%com.google.ads.googleads.v16.servicesB\x1e\x41\x64GroupBidModifierServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AdGroupBidModifier", "google/ads/googleads/v16/resources/ad_group_bid_modifier.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupBidModifiersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupBidModifiersRequest").msgclass + AdGroupBidModifierOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupBidModifierOperation").msgclass + MutateAdGroupBidModifiersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupBidModifiersResponse").msgclass + MutateAdGroupBidModifierResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupBidModifierResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service_services_pb.rb new file mode 100644 index 000000000..d13571a60 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_bid_modifier_service_services_pb.rb @@ -0,0 +1,75 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_bid_modifier_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_bid_modifier_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + 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.v16.services.AdGroupBidModifierService' + + # Creates, updates, or removes ad group bid modifiers. + # Operation statuses are returned. + # + # List of thrown errors: + # [AdGroupBidModifierError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [CriterionError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateAdGroupBidModifiers, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupBidModifiersResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service.rb new file mode 100644 index 000000000..9a52b1d7c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/paths" +require "google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ad group criterion customizer + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_criterion_customizer_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client.new + # + module AdGroupCriterionCustomizerService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_criterion_customizer_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/client.rb new file mode 100644 index 000000000..09e90826e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionCustomizerService + ## + # Client for the AdGroupCriterionCustomizerService service. + # + # Service to manage ad group criterion customizer + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_criterion_customizer_service_stub + + ## + # Configure the AdGroupCriterionCustomizerService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupCriterionCustomizerService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupCriterionCustomizerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_criterion_customizer_service_stub.universe_domain + end + + ## + # Create a new AdGroupCriterionCustomizerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupCriterionCustomizerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_criterion_customizer_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes ad group criterion customizers. Operation + # statuses are returned. + # + # @overload mutate_ad_group_criterion_customizers(request, options = nil) + # Pass arguments to `mutate_ad_group_criterion_customizers` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_criterion_customizers(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_group_criterion_customizers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ad group criterion customizers are + # being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerOperation, ::Hash>] + # Required. The list of operations to perform on individual ad group + # criterion customizers. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersRequest.new + # + # # Call the mutate_ad_group_criterion_customizers method. + # result = client.mutate_ad_group_criterion_customizers request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersResponse. + # p result + # + def mutate_ad_group_criterion_customizers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_criterion_customizers.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_criterion_customizers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_criterion_customizers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_criterion_customizer_service_stub.call_rpc :mutate_ad_group_criterion_customizers, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupCriterionCustomizerService API. + # + # This class represents the configuration for AdGroupCriterionCustomizerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_criterion_customizers to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_criterion_customizers.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionCustomizerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_criterion_customizers.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupCriterionCustomizerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_criterion_customizers` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_criterion_customizers + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_criterion_customizers_config = parent_rpcs.mutate_ad_group_criterion_customizers if parent_rpcs.respond_to? :mutate_ad_group_criterion_customizers + @mutate_ad_group_criterion_customizers = ::Gapic::Config::Method.new mutate_ad_group_criterion_customizers_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/credentials.rb new file mode 100644 index 000000000..0a8fa43ce --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionCustomizerService + # Credentials for the AdGroupCriterionCustomizerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/paths.rb new file mode 100644 index 000000000..76fd6585a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service/paths.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionCustomizerService + # Path helper methods for the AdGroupCriterionCustomizerService API. + module Paths + ## + # Create a fully-qualified AdGroupCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_criterion_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriteria/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdGroupCriterionCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriterionCustomizers/{ad_group_id}~{criterion_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def ad_group_criterion_customizer_path customer_id:, ad_group_id:, criterion_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriterionCustomizers/#{ad_group_id}~#{criterion_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified CustomizerAttribute resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customizerAttributes/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customizer_attribute_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customizerAttributes/#{customizer_attribute_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_pb.rb new file mode 100644 index 000000000..bed66cb3d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_criterion_customizer_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_criterion_customizer_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nMgoogle/ads/googleads/v16/services/ad_group_criterion_customizer_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x46google/ads/googleads/v16/resources/ad_group_criterion_customizer.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xc1\x02\n(MutateAdGroupCriterionCustomizersRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12_\n\noperations\x18\x02 \x03(\x0b\x32\x46.google.ads.googleads.v16.services.AdGroupCriterionCustomizerOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xd0\x01\n#AdGroupCriterionCustomizerOperation\x12P\n\x06\x63reate\x18\x01 \x01(\x0b\x32>.google.ads.googleads.v16.resources.AdGroupCriterionCustomizerH\x00\x12J\n\x06remove\x18\x02 \x01(\tB8\xfa\x41\x35\n3googleads.googleapis.com/AdGroupCriterionCustomizerH\x00\x42\x0b\n\toperation\"\xba\x01\n)MutateAdGroupCriterionCustomizersResponse\x12Z\n\x07results\x18\x01 \x03(\x0b\x32I.google.ads.googleads.v16.services.MutateAdGroupCriterionCustomizerResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xe0\x01\n&MutateAdGroupCriterionCustomizerResult\x12O\n\rresource_name\x18\x01 \x01(\tB8\xfa\x41\x35\n3googleads.googleapis.com/AdGroupCriterionCustomizer\x12\x65\n\x1d\x61\x64_group_criterion_customizer\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.resources.AdGroupCriterionCustomizer2\x92\x03\n!AdGroupCriterionCustomizerService\x12\xa5\x02\n!MutateAdGroupCriterionCustomizers\x12K.google.ads.googleads.v16.services.MutateAdGroupCriterionCustomizersRequest\x1aL.google.ads.googleads.v16.services.MutateAdGroupCriterionCustomizersResponse\"e\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x46\"A/v16/customers/{customer_id=*}/AdGroupCriterionCustomizers:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x92\x02\n%com.google.ads.googleads.v16.servicesB&AdGroupCriterionCustomizerServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.AdGroupCriterionCustomizer", "google/ads/googleads/v16/resources/ad_group_criterion_customizer.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupCriterionCustomizersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupCriterionCustomizersRequest").msgclass + AdGroupCriterionCustomizerOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupCriterionCustomizerOperation").msgclass + MutateAdGroupCriterionCustomizersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupCriterionCustomizersResponse").msgclass + MutateAdGroupCriterionCustomizerResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupCriterionCustomizerResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_services_pb.rb new file mode 100644 index 000000000..b231b2788 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_criterion_customizer_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_criterion_customizer_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionCustomizerService + # Proto file describing the AdGroupCriterionCustomizer service. + # + # Service to manage ad group criterion customizer + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupCriterionCustomizerService' + + # Creates, updates or removes ad group criterion customizers. Operation + # statuses are returned. + rpc :MutateAdGroupCriterionCustomizers, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionCustomizersResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service.rb new file mode 100644 index 000000000..dd9cb9b11 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_criterion_label_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_criterion_label_service/paths" +require "google/ads/google_ads/v16/services/ad_group_criterion_label_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage labels on ad group criteria. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_criterion_label_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client.new + # + module AdGroupCriterionLabelService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_criterion_label_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_criterion_label_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/client.rb new file mode 100644 index 000000000..8749ce9f9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/client.rb @@ -0,0 +1,446 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_criterion_label_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionLabelService + ## + # Client for the AdGroupCriterionLabelService service. + # + # Service to manage labels on ad group criteria. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_criterion_label_service_stub + + ## + # Configure the AdGroupCriterionLabelService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupCriterionLabelService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupCriterionLabelService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_criterion_label_service_stub.universe_domain + end + + ## + # Create a new AdGroupCriterionLabelService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupCriterionLabelService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_criterion_label_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_criterion_label_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates and removes ad group criterion labels. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_ad_group_criterion_labels(request, options = nil) + # Pass arguments to `mutate_ad_group_criterion_labels` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionLabelsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionLabelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_criterion_labels(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_ad_group_criterion_labels` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. ID of the customer whose ad group criterion labels are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelOperation, ::Hash>] + # Required. The list of operations to perform on ad group criterion labels. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionLabelsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionLabelsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionLabelsRequest.new + # + # # Call the mutate_ad_group_criterion_labels method. + # result = client.mutate_ad_group_criterion_labels request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionLabelsResponse. + # p result + # + def mutate_ad_group_criterion_labels request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriterionLabelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_criterion_labels.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_criterion_labels.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_criterion_labels.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_criterion_label_service_stub.call_rpc :mutate_ad_group_criterion_labels, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupCriterionLabelService API. + # + # This class represents the configuration for AdGroupCriterionLabelService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_criterion_labels to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_criterion_labels.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionLabelService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_criterion_labels.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupCriterionLabelService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_criterion_labels` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_criterion_labels + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_criterion_labels_config = parent_rpcs.mutate_ad_group_criterion_labels if parent_rpcs.respond_to? :mutate_ad_group_criterion_labels + @mutate_ad_group_criterion_labels = ::Gapic::Config::Method.new mutate_ad_group_criterion_labels_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/credentials.rb new file mode 100644 index 000000000..d53f2c73c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionLabelService + # Credentials for the AdGroupCriterionLabelService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/paths.rb new file mode 100644 index 000000000..6f60f7c3d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service/paths.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionLabelService + # Path helper methods for the AdGroupCriterionLabelService API. + module Paths + ## + # Create a fully-qualified AdGroupCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_criterion_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriteria/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdGroupCriterionLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriterionLabels/{ad_group_id}~{criterion_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_criterion_label_path customer_id:, ad_group_id:, criterion_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriterionLabels/#{ad_group_id}~#{criterion_id}~#{label_id}" + end + + ## + # Create a fully-qualified Label resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/labels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/labels/#{label_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service_pb.rb new file mode 100644 index 000000000..11b064004 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_label_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_criterion_label_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/ad_group_criterion_label_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nHgoogle/ads/googleads/v16/services/ad_group_criterion_label_service.proto\x12!google.ads.googleads.v16.services\x1a\x41google/ads/googleads/v16/resources/ad_group_criterion_label.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xcb\x01\n#MutateAdGroupCriterionLabelsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Z\n\noperations\x18\x02 \x03(\x0b\x32\x41.google.ads.googleads.v16.services.AdGroupCriterionLabelOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xc1\x01\n\x1e\x41\x64GroupCriterionLabelOperation\x12K\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.AdGroupCriterionLabelH\x00\x12\x45\n\x06remove\x18\x02 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/AdGroupCriterionLabelH\x00\x42\x0b\n\toperation\"\xb0\x01\n$MutateAdGroupCriterionLabelsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12U\n\x07results\x18\x02 \x03(\x0b\x32\x44.google.ads.googleads.v16.services.MutateAdGroupCriterionLabelResult\"o\n!MutateAdGroupCriterionLabelResult\x12J\n\rresource_name\x18\x01 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/AdGroupCriterionLabel2\xf9\x02\n\x1c\x41\x64GroupCriterionLabelService\x12\x91\x02\n\x1cMutateAdGroupCriterionLabels\x12\x46.google.ads.googleads.v16.services.MutateAdGroupCriterionLabelsRequest\x1aG.google.ads.googleads.v16.services.MutateAdGroupCriterionLabelsResponse\"`\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x41\"] + # Required. The list of operations to perform on individual criteria. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriteriaResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriteriaResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupCriterionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriteriaRequest.new + # + # # Call the mutate_ad_group_criteria method. + # result = client.mutate_ad_group_criteria request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriteriaResponse. + # p result + # + def mutate_ad_group_criteria request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriteriaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_criteria.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_criteria.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_criteria.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_criterion_service_stub.call_rpc :mutate_ad_group_criteria, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupCriterionService API. + # + # This class represents the configuration for AdGroupCriterionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_criteria to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_criteria.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCriterionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_criteria.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupCriterionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_criteria` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_criteria + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_criteria_config = parent_rpcs.mutate_ad_group_criteria if parent_rpcs.respond_to? :mutate_ad_group_criteria + @mutate_ad_group_criteria = ::Gapic::Config::Method.new mutate_ad_group_criteria_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_service/credentials.rb new file mode 100644 index 000000000..78681d952 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionService + # Credentials for the AdGroupCriterionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_service/paths.rb new file mode 100644 index 000000000..62e9e9cf2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_service/paths.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionService + # Path helper methods for the AdGroupCriterionService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_criterion_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriteria/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdGroupCriterionLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriterionLabels/{ad_group_id}~{criterion_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_criterion_label_path customer_id:, ad_group_id:, criterion_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriterionLabels/#{ad_group_id}~#{criterion_id}~#{label_id}" + end + + ## + # Create a fully-qualified CombinedAudience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/combinedAudiences/{combined_audience_id}` + # + # @param customer_id [String] + # @param combined_audience_id [String] + # + # @return [::String] + def combined_audience_path customer_id:, combined_audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/combinedAudiences/#{combined_audience_id}" + end + + ## + # Create a fully-qualified MobileAppCategoryConstant resource string. + # + # The resource will be in the following format: + # + # `mobileAppCategoryConstants/{mobile_app_category_id}` + # + # @param mobile_app_category_id [String] + # + # @return [::String] + def mobile_app_category_constant_path mobile_app_category_id: + "mobileAppCategoryConstants/#{mobile_app_category_id}" + end + + ## + # Create a fully-qualified TopicConstant resource string. + # + # The resource will be in the following format: + # + # `topicConstants/{topic_id}` + # + # @param topic_id [String] + # + # @return [::String] + def topic_constant_path topic_id: + "topicConstants/#{topic_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_service_pb.rb new file mode 100644 index 000000000..bd6fc5416 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_service_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_criterion_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/policy_pb' +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_criterion_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/services/ad_group_criterion_service.proto\x12!google.ads.googleads.v16.services\x1a,google/ads/googleads/v16/common/policy.proto\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a;google/ads/googleads/v16/resources/ad_group_criterion.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xab\x02\n\x1cMutateAdGroupCriteriaRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12U\n\noperations\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.AdGroupCriterionOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x86\x03\n\x19\x41\x64GroupCriterionOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12Y\n\x1c\x65xempt_policy_violation_keys\x18\x05 \x03(\x0b\x32\x33.google.ads.googleads.v16.common.PolicyViolationKey\x12\x46\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.AdGroupCriterionH\x00\x12\x46\n\x06update\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.AdGroupCriterionH\x00\x12@\n\x06remove\x18\x03 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/AdGroupCriterionH\x00\x42\x0b\n\toperation\"\xa4\x01\n\x1dMutateAdGroupCriteriaResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12P\n\x07results\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.services.MutateAdGroupCriterionResult\"\xb7\x01\n\x1cMutateAdGroupCriterionResult\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/AdGroupCriterion\x12P\n\x12\x61\x64_group_criterion\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.AdGroupCriterion2\xd8\x02\n\x17\x41\x64GroupCriterionService\x12\xf5\x01\n\x15MutateAdGroupCriteria\x12?.google.ads.googleads.v16.services.MutateAdGroupCriteriaRequest\x1a@.google.ads.googleads.v16.services.MutateAdGroupCriteriaResponse\"Y\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}/adGroupCriteria:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x88\x02\n%com.google.ads.googleads.v16.servicesB\x1c\x41\x64GroupCriterionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.common.PolicyViolationKey", "google/ads/googleads/v16/common/policy.proto"], + ["google.ads.googleads.v16.resources.AdGroupCriterion", "google/ads/googleads/v16/resources/ad_group_criterion.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupCriteriaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupCriteriaRequest").msgclass + AdGroupCriterionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupCriterionOperation").msgclass + MutateAdGroupCriteriaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupCriteriaResponse").msgclass + MutateAdGroupCriterionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupCriterionResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_criterion_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_criterion_service_services_pb.rb new file mode 100644 index 000000000..c903c2cee --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_criterion_service_services_pb.rb @@ -0,0 +1,84 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_criterion_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_criterion_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCriterionService + # Proto file describing the Ad Group Criterion service. + # + # Service to manage ad group criteria. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupCriterionService' + + # Creates, updates, or removes criteria. Operation statuses are returned. + # + # List of thrown errors: + # [AdGroupCriterionError]() + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [BiddingStrategyError]() + # [CollectionSizeError]() + # [ContextError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MultiplierError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateAdGroupCriteria, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriteriaRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCriteriaResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_customizer_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service.rb new file mode 100644 index 000000000..611816cb1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_customizer_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_customizer_service/paths" +require "google/ads/google_ads/v16/services/ad_group_customizer_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ad group customizer + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_customizer_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client.new + # + module AdGroupCustomizerService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_customizer_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_customizer_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/client.rb new file mode 100644 index 000000000..030bed44f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_customizer_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCustomizerService + ## + # Client for the AdGroupCustomizerService service. + # + # Service to manage ad group customizer + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_customizer_service_stub + + ## + # Configure the AdGroupCustomizerService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupCustomizerService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupCustomizerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_customizer_service_stub.universe_domain + end + + ## + # Create a new AdGroupCustomizerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupCustomizerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_customizer_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_customizer_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes ad group customizers. Operation statuses are + # returned. + # + # @overload mutate_ad_group_customizers(request, options = nil) + # Pass arguments to `mutate_ad_group_customizers` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCustomizersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCustomizersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_customizers(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_group_customizers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ad group customizers are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerOperation, ::Hash>] + # Required. The list of operations to perform on individual ad group + # customizers. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCustomizersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCustomizersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupCustomizersRequest.new + # + # # Call the mutate_ad_group_customizers method. + # result = client.mutate_ad_group_customizers request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupCustomizersResponse. + # p result + # + def mutate_ad_group_customizers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupCustomizersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_customizers.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_customizers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_customizers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_customizer_service_stub.call_rpc :mutate_ad_group_customizers, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupCustomizerService API. + # + # This class represents the configuration for AdGroupCustomizerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_customizers to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_customizers.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupCustomizerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_customizers.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupCustomizerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_customizers` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_customizers + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_customizers_config = parent_rpcs.mutate_ad_group_customizers if parent_rpcs.respond_to? :mutate_ad_group_customizers + @mutate_ad_group_customizers = ::Gapic::Config::Method.new mutate_ad_group_customizers_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/credentials.rb new file mode 100644 index 000000000..44ec15278 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCustomizerService + # Credentials for the AdGroupCustomizerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/paths.rb new file mode 100644 index 000000000..5b2869aa9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupCustomizerService + # Path helper methods for the AdGroupCustomizerService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCustomizers/{ad_group_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def ad_group_customizer_path customer_id:, ad_group_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCustomizers/#{ad_group_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified CustomizerAttribute resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customizerAttributes/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customizer_attribute_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customizerAttributes/#{customizer_attribute_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_customizer_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service_pb.rb new file mode 100644 index 000000000..8037c302b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_customizer_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_customizer_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_customizer_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/services/ad_group_customizer_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a] + # Required. The list of operations to perform on individual ad group + # extension settings. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupExtensionSettingsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupExtensionSettingsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupExtensionSettingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupExtensionSettingsRequest.new + # + # # Call the mutate_ad_group_extension_settings method. + # result = client.mutate_ad_group_extension_settings request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupExtensionSettingsResponse. + # p result + # + def mutate_ad_group_extension_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupExtensionSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_extension_settings.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_extension_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_extension_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_extension_setting_service_stub.call_rpc :mutate_ad_group_extension_settings, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupExtensionSettingService API. + # + # This class represents the configuration for AdGroupExtensionSettingService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupExtensionSettingService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_extension_settings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupExtensionSettingService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_extension_settings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupExtensionSettingService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_extension_settings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupExtensionSettingService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_extension_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_extension_settings + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_extension_settings_config = parent_rpcs.mutate_ad_group_extension_settings if parent_rpcs.respond_to? :mutate_ad_group_extension_settings + @mutate_ad_group_extension_settings = ::Gapic::Config::Method.new mutate_ad_group_extension_settings_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service/credentials.rb new file mode 100644 index 000000000..d0da27047 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupExtensionSettingService + # Credentials for the AdGroupExtensionSettingService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service/paths.rb new file mode 100644 index 000000000..b1f3fb9de --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupExtensionSettingService + # Path helper methods for the AdGroupExtensionSettingService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupExtensionSettings/{ad_group_id}~{extension_type}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param extension_type [String] + # + # @return [::String] + def ad_group_extension_setting_path customer_id:, ad_group_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupExtensionSettings/#{ad_group_id}~#{extension_type}" + end + + ## + # Create a fully-qualified ExtensionFeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/extensionFeedItems/{feed_item_id}` + # + # @param customer_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def extension_feed_item_path customer_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/extensionFeedItems/#{feed_item_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service_pb.rb new file mode 100644 index 000000000..a50cee2ed --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_extension_setting_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_extension_setting_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nJgoogle/ads/googleads/v16/services/ad_group_extension_setting_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x43google/ads/googleads/v16/resources/ad_group_extension_setting.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xcf\x01\n%MutateAdGroupExtensionSettingsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\\\n\noperations\x18\x02 \x03(\x0b\x32\x43.google.ads.googleads.v16.services.AdGroupExtensionSettingOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xb3\x03\n AdGroupExtensionSettingOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\x12M\n\x06\x63reate\x18\x01 \x01(\x0b\x32;.google.ads.googleads.v16.resources.AdGroupExtensionSettingH\x00\x12M\n\x06update\x18\x02 \x01(\x0b\x32;.google.ads.googleads.v16.resources.AdGroupExtensionSettingH\x00\x12G\n\x06remove\x18\x03 \x01(\tB5\xfa\x41\x32\n0googleads.googleapis.com/AdGroupExtensionSettingH\x00\x42\x0b\n\toperation\"\xb4\x01\n&MutateAdGroupExtensionSettingsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12W\n\x07results\x18\x02 \x03(\x0b\x32\x46.google.ads.googleads.v16.services.MutateAdGroupExtensionSettingResult\"\xd4\x01\n#MutateAdGroupExtensionSettingResult\x12L\n\rresource_name\x18\x01 \x01(\tB5\xfa\x41\x32\n0googleads.googleapis.com/AdGroupExtensionSetting\x12_\n\x1a\x61\x64_group_extension_setting\x18\x02 \x01(\x0b\x32;.google.ads.googleads.v16.resources.AdGroupExtensionSetting2\x83\x03\n\x1e\x41\x64GroupExtensionSettingService\x12\x99\x02\n\x1eMutateAdGroupExtensionSettings\x12H.google.ads.googleads.v16.services.MutateAdGroupExtensionSettingsRequest\x1aI.google.ads.googleads.v16.services.MutateAdGroupExtensionSettingsResponse\"b\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x43\">/v16/customers/{customer_id=*}/adGroupExtensionSettings:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8f\x02\n%com.google.ads.googleads.v16.servicesB#AdGroupExtensionSettingServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AdGroupExtensionSetting", "google/ads/googleads/v16/resources/ad_group_extension_setting.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupExtensionSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupExtensionSettingsRequest").msgclass + AdGroupExtensionSettingOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupExtensionSettingOperation").msgclass + MutateAdGroupExtensionSettingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupExtensionSettingsResponse").msgclass + MutateAdGroupExtensionSettingResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupExtensionSettingResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service_services_pb.rb new file mode 100644 index 000000000..702f601c8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_extension_setting_service_services_pb.rb @@ -0,0 +1,80 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_extension_setting_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_extension_setting_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupExtensionSettingService + # Proto file describing the AdGroupExtensionSetting service. + # + # Service to manage ad group extension settings. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupExtensionSettingService' + + # Creates, updates, or removes ad group extension settings. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [ExtensionSettingError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateAdGroupExtensionSettings, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupExtensionSettingsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupExtensionSettingsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_feed_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_feed_service.rb new file mode 100644 index 000000000..adf4c09ca --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_feed_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_feed_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_feed_service/paths" +require "google/ads/google_ads/v16/services/ad_group_feed_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ad group feeds. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_feed_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client.new + # + module AdGroupFeedService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_feed_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_feed_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_feed_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_feed_service/client.rb new file mode 100644 index 000000000..c4041739c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_feed_service/client.rb @@ -0,0 +1,462 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_feed_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupFeedService + ## + # Client for the AdGroupFeedService service. + # + # Service to manage ad group feeds. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_feed_service_stub + + ## + # Configure the AdGroupFeedService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupFeedService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupFeedService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_feed_service_stub.universe_domain + end + + ## + # Create a new AdGroupFeedService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupFeedService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_feed_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_feed_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes ad group feeds. Operation statuses are + # returned. + # + # List of thrown errors: + # [AdGroupFeedError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_ad_group_feeds(request, options = nil) + # Pass arguments to `mutate_ad_group_feeds` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_feeds(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_group_feeds` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ad group feeds are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupFeedOperation, ::Hash>] + # Required. The list of operations to perform on individual ad group feeds. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsRequest.new + # + # # Call the mutate_ad_group_feeds method. + # result = client.mutate_ad_group_feeds request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsResponse. + # p result + # + def mutate_ad_group_feeds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_feeds.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_feeds.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_feeds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_feed_service_stub.call_rpc :mutate_ad_group_feeds, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupFeedService API. + # + # This class represents the configuration for AdGroupFeedService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_feeds to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_feeds.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupFeedService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_feeds.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupFeedService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_feeds` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_feeds + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_feeds_config = parent_rpcs.mutate_ad_group_feeds if parent_rpcs.respond_to? :mutate_ad_group_feeds + @mutate_ad_group_feeds = ::Gapic::Config::Method.new mutate_ad_group_feeds_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_feed_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_feed_service/credentials.rb new file mode 100644 index 000000000..b522d1cec --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_feed_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupFeedService + # Credentials for the AdGroupFeedService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_feed_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_feed_service/paths.rb new file mode 100644 index 000000000..fdda9df99 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_feed_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupFeedService + # Path helper methods for the AdGroupFeedService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupFeeds/{ad_group_id}~{feed_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param feed_id [String] + # + # @return [::String] + def ad_group_feed_path customer_id:, ad_group_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupFeeds/#{ad_group_id}~#{feed_id}" + end + + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_feed_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_feed_service_pb.rb new file mode 100644 index 000000000..1e0f82eef --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_feed_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_feed_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_feed_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/services/ad_group_feed_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x36google/ads/googleads/v16/resources/ad_group_feed.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa3\x02\n\x19MutateAdGroupFeedsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12P\n\noperations\x18\x02 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.AdGroupFeedOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x97\x02\n\x14\x41\x64GroupFeedOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x41\n\x06\x63reate\x18\x01 \x01(\x0b\x32/.google.ads.googleads.v16.resources.AdGroupFeedH\x00\x12\x41\n\x06update\x18\x02 \x01(\x0b\x32/.google.ads.googleads.v16.resources.AdGroupFeedH\x00\x12;\n\x06remove\x18\x03 \x01(\tB)\xfa\x41&\n$googleads.googleapis.com/AdGroupFeedH\x00\x42\x0b\n\toperation\"\x9c\x01\n\x1aMutateAdGroupFeedsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12K\n\x07results\x18\x02 \x03(\x0b\x32:.google.ads.googleads.v16.services.MutateAdGroupFeedResult\"\xa3\x01\n\x17MutateAdGroupFeedResult\x12@\n\rresource_name\x18\x01 \x01(\tB)\xfa\x41&\n$googleads.googleapis.com/AdGroupFeed\x12\x46\n\rad_group_feed\x18\x02 \x01(\x0b\x32/.google.ads.googleads.v16.resources.AdGroupFeed2\xc7\x02\n\x12\x41\x64GroupFeedService\x12\xe9\x01\n\x12MutateAdGroupFeeds\x12<.google.ads.googleads.v16.services.MutateAdGroupFeedsRequest\x1a=.google.ads.googleads.v16.services.MutateAdGroupFeedsResponse\"V\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x37\"2/v16/customers/{customer_id=*}/adGroupFeeds:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x83\x02\n%com.google.ads.googleads.v16.servicesB\x17\x41\x64GroupFeedServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AdGroupFeed", "google/ads/googleads/v16/resources/ad_group_feed.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupFeedsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupFeedsRequest").msgclass + AdGroupFeedOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupFeedOperation").msgclass + MutateAdGroupFeedsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupFeedsResponse").msgclass + MutateAdGroupFeedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupFeedResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_feed_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_feed_service_services_pb.rb new file mode 100644 index 000000000..d32488e90 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_feed_service_services_pb.rb @@ -0,0 +1,74 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_feed_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_feed_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupFeedService + # Proto file describing the AdGroupFeed service. + # + # Service to manage ad group feeds. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupFeedService' + + # Creates, updates, or removes ad group feeds. Operation statuses are + # returned. + # + # List of thrown errors: + # [AdGroupFeedError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateAdGroupFeeds, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupFeedsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_label_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_label_service.rb new file mode 100644 index 000000000..7d7686b2c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_label_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_label_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_label_service/paths" +require "google/ads/google_ads/v16/services/ad_group_label_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage labels on ad groups. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_label_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client.new + # + module AdGroupLabelService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_label_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_label_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_label_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_label_service/client.rb new file mode 100644 index 000000000..c63f3ff4e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_label_service/client.rb @@ -0,0 +1,448 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_label_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupLabelService + ## + # Client for the AdGroupLabelService service. + # + # Service to manage labels on ad groups. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_label_service_stub + + ## + # Configure the AdGroupLabelService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupLabelService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupLabelService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_label_service_stub.universe_domain + end + + ## + # Create a new AdGroupLabelService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupLabelService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_label_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_label_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates and removes ad group labels. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_ad_group_labels(request, options = nil) + # Pass arguments to `mutate_ad_group_labels` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_group_labels(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_ad_group_labels` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. ID of the customer whose ad group labels are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupLabelOperation, ::Hash>] + # Required. The list of operations to perform on ad group labels. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsRequest.new + # + # # Call the mutate_ad_group_labels method. + # result = client.mutate_ad_group_labels request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsResponse. + # p result + # + def mutate_ad_group_labels request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_group_labels.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_group_labels.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_group_labels.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_label_service_stub.call_rpc :mutate_ad_group_labels, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupLabelService API. + # + # This class represents the configuration for AdGroupLabelService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_group_labels to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_labels.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupLabelService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_group_labels.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupLabelService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_group_labels` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_group_labels + + # @private + def initialize parent_rpcs = nil + mutate_ad_group_labels_config = parent_rpcs.mutate_ad_group_labels if parent_rpcs.respond_to? :mutate_ad_group_labels + @mutate_ad_group_labels = ::Gapic::Config::Method.new mutate_ad_group_labels_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_label_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_label_service/credentials.rb new file mode 100644 index 000000000..472e89289 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_label_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupLabelService + # Credentials for the AdGroupLabelService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_label_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_label_service/paths.rb new file mode 100644 index 000000000..500784bfc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_label_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupLabelService + # Path helper methods for the AdGroupLabelService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupLabels/{ad_group_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_label_path customer_id:, ad_group_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupLabels/#{ad_group_id}~#{label_id}" + end + + ## + # Create a fully-qualified Label resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/labels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/labels/#{label_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_label_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_label_service_pb.rb new file mode 100644 index 000000000..4fe827c38 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_label_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_label_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/ad_group_label_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/ad_group_label_service.proto\x12!google.ads.googleads.v16.services\x1a\x37google/ads/googleads/v16/resources/ad_group_label.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xb9\x01\n\x1aMutateAdGroupLabelsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Q\n\noperations\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.AdGroupLabelOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xa6\x01\n\x15\x41\x64GroupLabelOperation\x12\x42\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.AdGroupLabelH\x00\x12<\n\x06remove\x18\x02 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/AdGroupLabelH\x00\x42\x0b\n\toperation\"\x9e\x01\n\x1bMutateAdGroupLabelsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12L\n\x07results\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.MutateAdGroupLabelResult\"]\n\x18MutateAdGroupLabelResult\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/AdGroupLabel2\xcc\x02\n\x13\x41\x64GroupLabelService\x12\xed\x01\n\x13MutateAdGroupLabels\x12=.google.ads.googleads.v16.services.MutateAdGroupLabelsRequest\x1a>.google.ads.googleads.v16.services.MutateAdGroupLabelsResponse\"W\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x38\"3/v16/customers/{customer_id=*}/adGroupLabels:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x84\x02\n%com.google.ads.googleads.v16.servicesB\x18\x41\x64GroupLabelServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.AdGroupLabel", "google/ads/googleads/v16/resources/ad_group_label.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupLabelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupLabelsRequest").msgclass + AdGroupLabelOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupLabelOperation").msgclass + MutateAdGroupLabelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupLabelsResponse").msgclass + MutateAdGroupLabelResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupLabelResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_label_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_label_service_services_pb.rb new file mode 100644 index 000000000..c3a55fc34 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_label_service_services_pb.rb @@ -0,0 +1,63 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_label_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_label_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupLabelService + # Proto file describing the Ad Group Label service. + # + # Service to manage labels on ad groups. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupLabelService' + + # Creates and removes ad group labels. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateAdGroupLabels, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupLabelsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_service.rb b/lib/google/ads/google_ads/v16/services/ad_group_service.rb new file mode 100644 index 000000000..ad1acd750 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_group_service/credentials" +require "google/ads/google_ads/v16/services/ad_group_service/paths" +require "google/ads/google_ads/v16/services/ad_group_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ad groups. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_group_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client.new + # + module AdGroupService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_group_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_group_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_group_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_group_service/client.rb new file mode 100644 index 000000000..cd4f6e1f5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_service/client.rb @@ -0,0 +1,469 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_group_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupService + ## + # Client for the AdGroupService service. + # + # Service to manage ad groups. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_group_service_stub + + ## + # Configure the AdGroupService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdGroupService clients + # ::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdGroupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_group_service_stub.universe_domain + end + + ## + # Create a new AdGroupService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdGroupService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_group_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_group_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdGroupService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes ad groups. Operation statuses are returned. + # + # List of thrown errors: + # [AdGroupError]() + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [BiddingStrategyError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MultiplierError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SettingError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # + # @overload mutate_ad_groups(request, options = nil) + # Pass arguments to `mutate_ad_groups` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_groups(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ad groups are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdGroupOperation, ::Hash>] + # Required. The list of operations to perform on individual ad groups. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdGroupsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdGroupService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdGroupsRequest.new + # + # # Call the mutate_ad_groups method. + # result = client.mutate_ad_groups request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdGroupsResponse. + # p result + # + def mutate_ad_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_groups.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_group_service_stub.call_rpc :mutate_ad_groups, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdGroupService API. + # + # This class represents the configuration for AdGroupService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_groups to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_groups.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdGroupService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_groups.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdGroupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_groups + + # @private + def initialize parent_rpcs = nil + mutate_ad_groups_config = parent_rpcs.mutate_ad_groups if parent_rpcs.respond_to? :mutate_ad_groups + @mutate_ad_groups = ::Gapic::Config::Method.new mutate_ad_groups_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_group_service/credentials.rb new file mode 100644 index 000000000..b670ea05f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupService + # Credentials for the AdGroupService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_group_service/paths.rb new file mode 100644 index 000000000..3ac411c54 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupService + # Path helper methods for the AdGroupService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupLabels/{ad_group_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_label_path customer_id:, ad_group_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupLabels/#{ad_group_id}~#{label_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_service_pb.rb new file mode 100644 index 000000000..908e54428 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_group_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_group_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/services/ad_group_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x31google/ads/googleads/v16/resources/ad_group.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x9b\x02\n\x15MutateAdGroupsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\noperations\x18\x02 \x03(\x0b\x32\x33.google.ads.googleads.v16.services.AdGroupOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x87\x02\n\x10\x41\x64GroupOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12=\n\x06\x63reate\x18\x01 \x01(\x0b\x32+.google.ads.googleads.v16.resources.AdGroupH\x00\x12=\n\x06update\x18\x02 \x01(\x0b\x32+.google.ads.googleads.v16.resources.AdGroupH\x00\x12\x37\n\x06remove\x18\x03 \x01(\tB%\xfa\x41\"\n googleads.googleapis.com/AdGroupH\x00\x42\x0b\n\toperation\"\x94\x01\n\x16MutateAdGroupsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12G\n\x07results\x18\x02 \x03(\x0b\x32\x36.google.ads.googleads.v16.services.MutateAdGroupResult\"\x92\x01\n\x13MutateAdGroupResult\x12<\n\rresource_name\x18\x01 \x01(\tB%\xfa\x41\"\n googleads.googleapis.com/AdGroup\x12=\n\x08\x61\x64_group\x18\x02 \x01(\x0b\x32+.google.ads.googleads.v16.resources.AdGroup2\xb3\x02\n\x0e\x41\x64GroupService\x12\xd9\x01\n\x0eMutateAdGroups\x12\x38.google.ads.googleads.v16.services.MutateAdGroupsRequest\x1a\x39.google.ads.googleads.v16.services.MutateAdGroupsResponse\"R\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x33\"./v16/customers/{customer_id=*}/adGroups:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\xff\x01\n%com.google.ads.googleads.v16.servicesB\x13\x41\x64GroupServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AdGroup", "google/ads/googleads/v16/resources/ad_group.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAdGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupsRequest").msgclass + AdGroupOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupOperation").msgclass + MutateAdGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupsResponse").msgclass + MutateAdGroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdGroupResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_group_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_group_service_services_pb.rb new file mode 100644 index 000000000..272cedb33 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_group_service_services_pb.rb @@ -0,0 +1,82 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_group_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_group_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdGroupService + # Proto file describing the Ad Group service. + # + # Service to manage ad groups. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdGroupService' + + # Creates, updates, or removes ad groups. Operation statuses are returned. + # + # List of thrown errors: + # [AdGroupError]() + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [BiddingStrategyError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MultiplierError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SettingError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateAdGroups, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdGroupsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_parameter_service.rb b/lib/google/ads/google_ads/v16/services/ad_parameter_service.rb new file mode 100644 index 000000000..a16906e57 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_parameter_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/ad_parameter_service/credentials" +require "google/ads/google_ads/v16/services/ad_parameter_service/paths" +require "google/ads/google_ads/v16/services/ad_parameter_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage ad parameters. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/ad_parameter_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client.new + # + module AdParameterService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "ad_parameter_service", "helpers.rb" +require "google/ads/google_ads/v16/services/ad_parameter_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/ad_parameter_service/client.rb b/lib/google/ads/google_ads/v16/services/ad_parameter_service/client.rb new file mode 100644 index 000000000..c8702af17 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_parameter_service/client.rb @@ -0,0 +1,452 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/ad_parameter_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdParameterService + ## + # Client for the AdParameterService service. + # + # Service to manage ad parameters. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ad_parameter_service_stub + + ## + # Configure the AdParameterService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AdParameterService clients + # ::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AdParameterService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ad_parameter_service_stub.universe_domain + end + + ## + # Create a new AdParameterService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AdParameterService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/ad_parameter_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ad_parameter_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AdParameterService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes ad parameters. Operation statuses are + # returned. + # + # List of thrown errors: + # [AdParameterError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_ad_parameters(request, options = nil) + # Pass arguments to `mutate_ad_parameters` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdParametersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdParametersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ad_parameters(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_ad_parameters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ad parameters are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdParameterOperation, ::Hash>] + # Required. The list of operations to perform on individual ad parameters. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdParametersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdParametersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdParameterService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdParametersRequest.new + # + # # Call the mutate_ad_parameters method. + # result = client.mutate_ad_parameters request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdParametersResponse. + # p result + # + def mutate_ad_parameters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdParametersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ad_parameters.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ad_parameters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ad_parameters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_parameter_service_stub.call_rpc :mutate_ad_parameters, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdParameterService API. + # + # This class represents the configuration for AdParameterService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_ad_parameters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_parameters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdParameterService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_ad_parameters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdParameterService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_ad_parameters` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ad_parameters + + # @private + def initialize parent_rpcs = nil + mutate_ad_parameters_config = parent_rpcs.mutate_ad_parameters if parent_rpcs.respond_to? :mutate_ad_parameters + @mutate_ad_parameters = ::Gapic::Config::Method.new mutate_ad_parameters_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_parameter_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_parameter_service/credentials.rb new file mode 100644 index 000000000..023eb3ab3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_parameter_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdParameterService + # Credentials for the AdParameterService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_parameter_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_parameter_service/paths.rb new file mode 100644 index 000000000..9d977a2db --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_parameter_service/paths.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdParameterService + # Path helper methods for the AdParameterService API. + module Paths + ## + # Create a fully-qualified AdGroupCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_criterion_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriteria/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdParameter resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adParameters/{ad_group_id}~{criterion_id}~{parameter_index}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param parameter_index [String] + # + # @return [::String] + def ad_parameter_path customer_id:, ad_group_id:, criterion_id:, parameter_index: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adParameters/#{ad_group_id}~#{criterion_id}~#{parameter_index}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_parameter_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_parameter_service_pb.rb new file mode 100644 index 000000000..ebbd02118 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_parameter_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_parameter_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_parameter_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Updates ads. Operation statuses are returned. Updating ads is not supported + # for TextAd, ExpandedDynamicSearchAd, GmailAd and ImageAd. + # + # List of thrown errors: + # [AdCustomizerError]() + # [AdError]() + # [AdSharingError]() + # [AdxError]() + # [AssetError]() + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FeedAttributeReferenceError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [ImageError]() + # [InternalError]() + # [ListOperationError]() + # [MediaBundleError]() + # [MediaFileError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [PolicyFindingError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # + # @overload mutate_ads(request, options = nil) + # Pass arguments to `mutate_ads` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAdsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAdsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_ads(customer_id: nil, operations: nil, partial_failure: nil, response_content_type: nil, validate_only: nil) + # Pass arguments to `mutate_ads` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose ads are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AdOperation, ::Hash>] + # Required. The list of operations to perform on individual ads. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAdsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAdsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AdService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAdsRequest.new + # + # # Call the mutate_ads method. + # result = client.mutate_ads request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAdsResponse. + # p result + # + def mutate_ads request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAdsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_ads.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_ads.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_ads.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ad_service_stub.call_rpc :mutate_ads, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AdService API. + # + # This class represents the configuration for AdService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AdService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_ad to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AdService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_ad.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AdService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_ad.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AdService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_ad` + # @return [::Gapic::Config::Method] + # + attr_reader :get_ad + ## + # RPC-specific configuration for `mutate_ads` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_ads + + # @private + def initialize parent_rpcs = nil + get_ad_config = parent_rpcs.get_ad if parent_rpcs.respond_to? :get_ad + @get_ad = ::Gapic::Config::Method.new get_ad_config + mutate_ads_config = parent_rpcs.mutate_ads if parent_rpcs.respond_to? :mutate_ads + @mutate_ads = ::Gapic::Config::Method.new mutate_ads_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_service/credentials.rb b/lib/google/ads/google_ads/v16/services/ad_service/credentials.rb new file mode 100644 index 000000000..427386df9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdService + # Credentials for the AdService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_service/paths.rb b/lib/google/ads/google_ads/v16/services/ad_service/paths.rb new file mode 100644 index 000000000..d76ddda80 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdService + # Path helper methods for the AdService API. + module Paths + ## + # Create a fully-qualified Ad resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/ads/{ad_id}` + # + # @param customer_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_path customer_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/ads/#{ad_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_service_pb.rb b/lib/google/ads/google_ads/v16/services/ad_service_pb.rb new file mode 100644 index 000000000..32594f086 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/ad_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/policy_pb' +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/ad_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n2google/ads/googleads/v16/services/ad_service.proto\x12!google.ads.googleads.v16.services\x1a,google/ads/googleads/v16/common/policy.proto\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a+google/ads/googleads/v16/resources/ad.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"J\n\x0cGetAdRequest\x12:\n\rresource_name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bgoogleads.googleapis.com/Ad\"\x91\x02\n\x10MutateAdsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12G\n\noperations\x18\x02 \x03(\x0b\x32..google.ads.googleads.v16.services.AdOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xe6\x01\n\x0b\x41\x64Operation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12_\n\x1bpolicy_validation_parameter\x18\x03 \x01(\x0b\x32:.google.ads.googleads.v16.common.PolicyValidationParameter\x12\x38\n\x06update\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdH\x00\x42\x0b\n\toperation\"\x8a\x01\n\x11MutateAdsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x42\n\x07results\x18\x02 \x03(\x0b\x32\x31.google.ads.googleads.v16.services.MutateAdResult\"}\n\x0eMutateAdResult\x12\x37\n\rresource_name\x18\x01 \x01(\tB \xfa\x41\x1d\n\x1bgoogleads.googleapis.com/Ad\x12\x32\n\x02\x61\x64\x18\x02 \x01(\x0b\x32&.google.ads.googleads.v16.resources.Ad2\xbd\x03\n\tAdService\x12\xa0\x01\n\x05GetAd\x12/.google.ads.googleads.v16.services.GetAdRequest\x1a&.google.ads.googleads.v16.resources.Ad\">\xda\x41\rresource_name\x82\xd3\xe4\x93\x02(\x12&/v16/{resource_name=customers/*/ads/*}\x12\xc5\x01\n\tMutateAds\x12\x33.google.ads.googleads.v16.services.MutateAdsRequest\x1a\x34.google.ads.googleads.v16.services.MutateAdsResponse\"M\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02.\")/v16/customers/{customer_id=*}/ads:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\xfa\x01\n%com.google.ads.googleads.v16.servicesB\x0e\x41\x64ServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.common.PolicyValidationParameter", "google/ads/googleads/v16/common/policy.proto"], + ["google.ads.googleads.v16.resources.Ad", "google/ads/googleads/v16/resources/ad.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + GetAdRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GetAdRequest").msgclass + MutateAdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdsRequest").msgclass + AdOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdOperation").msgclass + MutateAdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdsResponse").msgclass + MutateAdResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAdResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/ad_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/ad_service_services_pb.rb new file mode 100644 index 000000000..00b8aab70 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/ad_service_services_pb.rb @@ -0,0 +1,100 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/ad_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/ad_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AdService + # Proto file describing the Ad service. + # + # Service to manage ads. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AdService' + + # Returns the requested ad in full detail. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :GetAd, ::Google::Ads::GoogleAds::V16::Services::GetAdRequest, ::Google::Ads::GoogleAds::V16::Resources::Ad + # Updates ads. Operation statuses are returned. Updating ads is not supported + # for TextAd, ExpandedDynamicSearchAd, GmailAd and ImageAd. + # + # List of thrown errors: + # [AdCustomizerError]() + # [AdError]() + # [AdSharingError]() + # [AdxError]() + # [AssetError]() + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FeedAttributeReferenceError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [ImageError]() + # [InternalError]() + # [ListOperationError]() + # [MediaBundleError]() + # [MediaFileError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [PolicyFindingError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateAds, ::Google::Ads::GoogleAds::V16::Services::MutateAdsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAdsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_asset_service.rb b/lib/google/ads/google_ads/v16/services/asset_group_asset_service.rb new file mode 100644 index 000000000..83c352892 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_asset_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/asset_group_asset_service/credentials" +require "google/ads/google_ads/v16/services/asset_group_asset_service/paths" +require "google/ads/google_ads/v16/services/asset_group_asset_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage asset group asset. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/asset_group_asset_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client.new + # + module AssetGroupAssetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "asset_group_asset_service", "helpers.rb" +require "google/ads/google_ads/v16/services/asset_group_asset_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/asset_group_asset_service/client.rb b/lib/google/ads/google_ads/v16/services/asset_group_asset_service/client.rb new file mode 100644 index 000000000..1b3fc357c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_asset_service/client.rb @@ -0,0 +1,437 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/asset_group_asset_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupAssetService + ## + # Client for the AssetGroupAssetService service. + # + # Service to manage asset group asset. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :asset_group_asset_service_stub + + ## + # Configure the AssetGroupAssetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssetGroupAssetService clients + # ::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssetGroupAssetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @asset_group_asset_service_stub.universe_domain + end + + ## + # Create a new AssetGroupAssetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssetGroupAssetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/asset_group_asset_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @asset_group_asset_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes asset group assets. Operation statuses are + # returned. + # + # @overload mutate_asset_group_assets(request, options = nil) + # Pass arguments to `mutate_asset_group_assets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_asset_group_assets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_asset_group_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose asset group assets are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetOperation, ::Hash>] + # Required. The list of operations to perform on individual asset group + # assets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsRequest.new + # + # # Call the mutate_asset_group_assets method. + # result = client.mutate_asset_group_assets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsResponse. + # p result + # + def mutate_asset_group_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_asset_group_assets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_asset_group_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_asset_group_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @asset_group_asset_service_stub.call_rpc :mutate_asset_group_assets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AssetGroupAssetService API. + # + # This class represents the configuration for AssetGroupAssetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_asset_group_assets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_group_assets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_group_assets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AssetGroupAssetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_asset_group_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_asset_group_assets + + # @private + def initialize parent_rpcs = nil + mutate_asset_group_assets_config = parent_rpcs.mutate_asset_group_assets if parent_rpcs.respond_to? :mutate_asset_group_assets + @mutate_asset_group_assets = ::Gapic::Config::Method.new mutate_asset_group_assets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_asset_service/credentials.rb b/lib/google/ads/google_ads/v16/services/asset_group_asset_service/credentials.rb new file mode 100644 index 000000000..ac6515f35 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_asset_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupAssetService + # Credentials for the AssetGroupAssetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_asset_service/paths.rb b/lib/google/ads/google_ads/v16/services/asset_group_asset_service/paths.rb new file mode 100644 index 000000000..7be7192cf --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_asset_service/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupAssetService + # Path helper methods for the AssetGroupAssetService API. + module Paths + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified AssetGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroups/{asset_group_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # + # @return [::String] + def asset_group_path customer_id:, asset_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroups/#{asset_group_id}" + end + + ## + # Create a fully-qualified AssetGroupAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupAssets/{asset_group_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def asset_group_asset_path customer_id:, asset_group_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupAssets/#{asset_group_id}~#{asset_id}~#{field_type}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_asset_service_pb.rb b/lib/google/ads/google_ads/v16/services/asset_group_asset_service_pb.rb new file mode 100644 index 000000000..553940cfc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_asset_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/asset_group_asset_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/asset_group_asset_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/services/asset_group_asset_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/resources/asset_group_asset.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xbf\x01\n\x1dMutateAssetGroupAssetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12T\n\noperations\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.AssetGroupAssetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xa7\x02\n\x18\x41ssetGroupAssetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x45\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.AssetGroupAssetH\x00\x12\x45\n\x06update\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.AssetGroupAssetH\x00\x12?\n\x06remove\x18\x03 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/AssetGroupAssetH\x00\x42\x0b\n\toperation\"\xa4\x01\n\x1eMutateAssetGroupAssetsResponse\x12O\n\x07results\x18\x01 \x03(\x0b\x32>.google.ads.googleads.v16.services.MutateAssetGroupAssetResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"c\n\x1bMutateAssetGroupAssetResult\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/AssetGroupAsset2\xdb\x02\n\x16\x41ssetGroupAssetService\x12\xf9\x01\n\x16MutateAssetGroupAssets\x12@.google.ads.googleads.v16.services.MutateAssetGroupAssetsRequest\x1a\x41.google.ads.googleads.v16.services.MutateAssetGroupAssetsResponse\"Z\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02;\"6/v16/customers/{customer_id=*}/assetGroupAssets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x87\x02\n%com.google.ads.googleads.v16.servicesB\x1b\x41ssetGroupAssetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AssetGroupAsset", "google/ads/googleads/v16/resources/asset_group_asset.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAssetGroupAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupAssetsRequest").msgclass + AssetGroupAssetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AssetGroupAssetOperation").msgclass + MutateAssetGroupAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupAssetsResponse").msgclass + MutateAssetGroupAssetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupAssetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_asset_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/asset_group_asset_service_services_pb.rb new file mode 100644 index 000000000..7c91d18e2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_asset_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/asset_group_asset_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/asset_group_asset_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupAssetService + # Proto file describing the AssetGroupAsset service. + # + # Service to manage asset group asset. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AssetGroupAssetService' + + # Creates, updates or removes asset group assets. Operation statuses are + # returned. + rpc :MutateAssetGroupAssets, ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupAssetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service.rb b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service.rb new file mode 100644 index 000000000..113cfd74c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/credentials" +require "google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/paths" +require "google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage asset group listing group filter. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/asset_group_listing_group_filter_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client.new + # + module AssetGroupListingGroupFilterService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "asset_group_listing_group_filter_service", "helpers.rb" +require "google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/client.rb b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/client.rb new file mode 100644 index 000000000..fcc778499 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/client.rb @@ -0,0 +1,435 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupListingGroupFilterService + ## + # Client for the AssetGroupListingGroupFilterService service. + # + # Service to manage asset group listing group filter. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :asset_group_listing_group_filter_service_stub + + ## + # Configure the AssetGroupListingGroupFilterService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssetGroupListingGroupFilterService clients + # ::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssetGroupListingGroupFilterService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @asset_group_listing_group_filter_service_stub.universe_domain + end + + ## + # Create a new AssetGroupListingGroupFilterService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssetGroupListingGroupFilterService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @asset_group_listing_group_filter_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes asset group listing group filters. Operation + # statuses are returned. + # + # @overload mutate_asset_group_listing_group_filters(request, options = nil) + # Pass arguments to `mutate_asset_group_listing_group_filters` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_asset_group_listing_group_filters(customer_id: nil, operations: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_asset_group_listing_group_filters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose asset group listing group filters + # are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterOperation, ::Hash>] + # Required. The list of operations to perform on individual asset group + # listing group filters. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersRequest.new + # + # # Call the mutate_asset_group_listing_group_filters method. + # result = client.mutate_asset_group_listing_group_filters request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersResponse. + # p result + # + def mutate_asset_group_listing_group_filters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_asset_group_listing_group_filters.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_asset_group_listing_group_filters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_asset_group_listing_group_filters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @asset_group_listing_group_filter_service_stub.call_rpc :mutate_asset_group_listing_group_filters, + request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AssetGroupListingGroupFilterService API. + # + # This class represents the configuration for AssetGroupListingGroupFilterService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_asset_group_listing_group_filters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_group_listing_group_filters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupListingGroupFilterService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_group_listing_group_filters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AssetGroupListingGroupFilterService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_asset_group_listing_group_filters` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_asset_group_listing_group_filters + + # @private + def initialize parent_rpcs = nil + mutate_asset_group_listing_group_filters_config = parent_rpcs.mutate_asset_group_listing_group_filters if parent_rpcs.respond_to? :mutate_asset_group_listing_group_filters + @mutate_asset_group_listing_group_filters = ::Gapic::Config::Method.new mutate_asset_group_listing_group_filters_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/credentials.rb b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/credentials.rb new file mode 100644 index 000000000..3116e1ecc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupListingGroupFilterService + # Credentials for the AssetGroupListingGroupFilterService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/paths.rb b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/paths.rb new file mode 100644 index 000000000..3048508d4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupListingGroupFilterService + # Path helper methods for the AssetGroupListingGroupFilterService API. + module Paths + ## + # Create a fully-qualified AssetGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroups/{asset_group_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # + # @return [::String] + def asset_group_path customer_id:, asset_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroups/#{asset_group_id}" + end + + ## + # Create a fully-qualified AssetGroupListingGroupFilter resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupListingGroupFilters/{asset_group_id}~{listing_group_filter_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param listing_group_filter_id [String] + # + # @return [::String] + def asset_group_listing_group_filter_path customer_id:, asset_group_id:, listing_group_filter_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupListingGroupFilters/#{asset_group_id}~#{listing_group_filter_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_pb.rb b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_pb.rb new file mode 100644 index 000000000..ba55ed759 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/asset_group_listing_group_filter_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/asset_group_listing_group_filter_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nPgoogle/ads/googleads/v16/services/asset_group_listing_group_filter_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1aIgoogle/ads/googleads/v16/resources/asset_group_listing_group_filter.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xac\x02\n*MutateAssetGroupListingGroupFiltersRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x61\n\noperations\x18\x02 \x03(\x0b\x32H.google.ads.googleads.v16.services.AssetGroupListingGroupFilterOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12j\n\x15response_content_type\x18\x04 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xdb\x02\n%AssetGroupListingGroupFilterOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12R\n\x06\x63reate\x18\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.AssetGroupListingGroupFilterH\x00\x12R\n\x06update\x18\x02 \x01(\x0b\x32@.google.ads.googleads.v16.resources.AssetGroupListingGroupFilterH\x00\x12L\n\x06remove\x18\x03 \x01(\tB:\xfa\x41\x37\n5googleads.googleapis.com/AssetGroupListingGroupFilterH\x00\x42\x0b\n\toperation\"\x8b\x01\n+MutateAssetGroupListingGroupFiltersResponse\x12\\\n\x07results\x18\x01 \x03(\x0b\x32K.google.ads.googleads.v16.services.MutateAssetGroupListingGroupFilterResult\"\xe9\x01\n(MutateAssetGroupListingGroupFilterResult\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xfa\x41\x37\n5googleads.googleapis.com/AssetGroupListingGroupFilter\x12j\n asset_group_listing_group_filter\x18\x02 \x01(\x0b\x32@.google.ads.googleads.v16.resources.AssetGroupListingGroupFilter2\x9c\x03\n#AssetGroupListingGroupFilterService\x12\xad\x02\n#MutateAssetGroupListingGroupFilters\x12M.google.ads.googleads.v16.services.MutateAssetGroupListingGroupFiltersRequest\x1aN.google.ads.googleads.v16.services.MutateAssetGroupListingGroupFiltersResponse\"g\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02H\"C/v16/customers/{customer_id=*}/assetGroupListingGroupFilters:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x94\x02\n%com.google.ads.googleads.v16.servicesB(AssetGroupListingGroupFilterServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AssetGroupListingGroupFilter", "google/ads/googleads/v16/resources/asset_group_listing_group_filter.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAssetGroupListingGroupFiltersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupListingGroupFiltersRequest").msgclass + AssetGroupListingGroupFilterOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AssetGroupListingGroupFilterOperation").msgclass + MutateAssetGroupListingGroupFiltersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupListingGroupFiltersResponse").msgclass + MutateAssetGroupListingGroupFilterResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupListingGroupFilterResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_services_pb.rb new file mode 100644 index 000000000..3c7f84165 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/asset_group_listing_group_filter_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/asset_group_listing_group_filter_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupListingGroupFilterService + # Proto file describing the AssetGroupListingGroupFilter service. + # + # Service to manage asset group listing group filter. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AssetGroupListingGroupFilterService' + + # Creates, updates or removes asset group listing group filters. Operation + # statuses are returned. + rpc :MutateAssetGroupListingGroupFilters, ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupListingGroupFiltersResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_service.rb b/lib/google/ads/google_ads/v16/services/asset_group_service.rb new file mode 100644 index 000000000..6c6b2e7fc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/asset_group_service/credentials" +require "google/ads/google_ads/v16/services/asset_group_service/paths" +require "google/ads/google_ads/v16/services/asset_group_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage asset group + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/asset_group_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client.new + # + module AssetGroupService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "asset_group_service", "helpers.rb" +require "google/ads/google_ads/v16/services/asset_group_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/asset_group_service/client.rb b/lib/google/ads/google_ads/v16/services/asset_group_service/client.rb new file mode 100644 index 000000000..002cf1eb8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_service/client.rb @@ -0,0 +1,430 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/asset_group_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupService + ## + # Client for the AssetGroupService service. + # + # Service to manage asset group + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :asset_group_service_stub + + ## + # Configure the AssetGroupService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssetGroupService clients + # ::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssetGroupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @asset_group_service_stub.universe_domain + end + + ## + # Create a new AssetGroupService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssetGroupService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/asset_group_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @asset_group_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes asset groups. Operation statuses are + # returned. + # + # @overload mutate_asset_groups(request, options = nil) + # Pass arguments to `mutate_asset_groups` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_asset_groups(customer_id: nil, operations: nil, validate_only: nil) + # Pass arguments to `mutate_asset_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose asset groups are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AssetGroupOperation, ::Hash>] + # Required. The list of operations to perform on individual asset groups. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsRequest.new + # + # # Call the mutate_asset_groups method. + # result = client.mutate_asset_groups request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsResponse. + # p result + # + def mutate_asset_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_asset_groups.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_asset_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_asset_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @asset_group_service_stub.call_rpc :mutate_asset_groups, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AssetGroupService API. + # + # This class represents the configuration for AssetGroupService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_asset_groups to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_groups.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_groups.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AssetGroupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_asset_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_asset_groups + + # @private + def initialize parent_rpcs = nil + mutate_asset_groups_config = parent_rpcs.mutate_asset_groups if parent_rpcs.respond_to? :mutate_asset_groups + @mutate_asset_groups = ::Gapic::Config::Method.new mutate_asset_groups_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_service/credentials.rb b/lib/google/ads/google_ads/v16/services/asset_group_service/credentials.rb new file mode 100644 index 000000000..b9c9a38e1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupService + # Credentials for the AssetGroupService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_service/paths.rb b/lib/google/ads/google_ads/v16/services/asset_group_service/paths.rb new file mode 100644 index 000000000..9fb0c3180 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupService + # Path helper methods for the AssetGroupService API. + module Paths + ## + # Create a fully-qualified AssetGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroups/{asset_group_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # + # @return [::String] + def asset_group_path customer_id:, asset_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroups/#{asset_group_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_service_pb.rb b/lib/google/ads/google_ads/v16/services/asset_group_service_pb.rb new file mode 100644 index 000000000..6045cc15b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/asset_group_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/asset_group_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n;google/ads/googleads/v16/services/asset_group_service.proto\x12!google.ads.googleads.v16.services\x1a\x34google/ads/googleads/v16/resources/asset_group.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x9c\x01\n\x18MutateAssetGroupsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12O\n\noperations\x18\x02 \x03(\x0b\x32\x36.google.ads.googleads.v16.services.AssetGroupOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x93\x02\n\x13\x41ssetGroupOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12@\n\x06\x63reate\x18\x01 \x01(\x0b\x32..google.ads.googleads.v16.resources.AssetGroupH\x00\x12@\n\x06update\x18\x02 \x01(\x0b\x32..google.ads.googleads.v16.resources.AssetGroupH\x00\x12:\n\x06remove\x18\x03 \x01(\tB(\xfa\x41%\n#googleads.googleapis.com/AssetGroupH\x00\x42\x0b\n\toperation\"\x9a\x01\n\x19MutateAssetGroupsResponse\x12J\n\x07results\x18\x01 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.MutateAssetGroupResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"Y\n\x16MutateAssetGroupResult\x12?\n\rresource_name\x18\x01 \x01(\tB(\xfa\x41%\n#googleads.googleapis.com/AssetGroup2\xc2\x02\n\x11\x41ssetGroupService\x12\xe5\x01\n\x11MutateAssetGroups\x12;.google.ads.googleads.v16.services.MutateAssetGroupsRequest\x1a<.google.ads.googleads.v16.services.MutateAssetGroupsResponse\"U\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x36\"1/v16/customers/{customer_id=*}/assetGroups:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x82\x02\n%com.google.ads.googleads.v16.servicesB\x16\x41ssetGroupServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AssetGroup", "google/ads/googleads/v16/resources/asset_group.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAssetGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupsRequest").msgclass + AssetGroupOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AssetGroupOperation").msgclass + MutateAssetGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupsResponse").msgclass + MutateAssetGroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/asset_group_service_services_pb.rb new file mode 100644 index 000000000..b82539d40 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/asset_group_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/asset_group_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupService + # Proto file describing the AssetGroup service. + # + # Service to manage asset group + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AssetGroupService' + + # Creates, updates or removes asset groups. Operation statuses are + # returned. + rpc :MutateAssetGroups, ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_signal_service.rb b/lib/google/ads/google_ads/v16/services/asset_group_signal_service.rb new file mode 100644 index 000000000..cbf3dc2bc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_signal_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/asset_group_signal_service/credentials" +require "google/ads/google_ads/v16/services/asset_group_signal_service/paths" +require "google/ads/google_ads/v16/services/asset_group_signal_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage asset group signal. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/asset_group_signal_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client.new + # + module AssetGroupSignalService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "asset_group_signal_service", "helpers.rb" +require "google/ads/google_ads/v16/services/asset_group_signal_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/asset_group_signal_service/client.rb b/lib/google/ads/google_ads/v16/services/asset_group_signal_service/client.rb new file mode 100644 index 000000000..a943606f7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_signal_service/client.rb @@ -0,0 +1,439 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/asset_group_signal_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupSignalService + ## + # Client for the AssetGroupSignalService service. + # + # Service to manage asset group signal. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :asset_group_signal_service_stub + + ## + # Configure the AssetGroupSignalService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssetGroupSignalService clients + # ::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssetGroupSignalService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @asset_group_signal_service_stub.universe_domain + end + + ## + # Create a new AssetGroupSignalService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssetGroupSignalService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/asset_group_signal_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @asset_group_signal_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or removes asset group signals. Operation statuses are + # returned. + # + # @overload mutate_asset_group_signals(request, options = nil) + # Pass arguments to `mutate_asset_group_signals` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_asset_group_signals(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_asset_group_signals` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose asset group signals are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalOperation, ::Hash>] + # Required. The list of operations to perform on individual asset group + # signals. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid operations + # will return errors. If false, all operations will be carried out in one + # transaction if and only if they are all valid. Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsRequest.new + # + # # Call the mutate_asset_group_signals method. + # result = client.mutate_asset_group_signals request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsResponse. + # p result + # + def mutate_asset_group_signals request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_asset_group_signals.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_asset_group_signals.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_asset_group_signals.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @asset_group_signal_service_stub.call_rpc :mutate_asset_group_signals, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AssetGroupSignalService API. + # + # This class represents the configuration for AssetGroupSignalService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_asset_group_signals to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_group_signals.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AssetGroupSignalService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_group_signals.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AssetGroupSignalService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_asset_group_signals` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_asset_group_signals + + # @private + def initialize parent_rpcs = nil + mutate_asset_group_signals_config = parent_rpcs.mutate_asset_group_signals if parent_rpcs.respond_to? :mutate_asset_group_signals + @mutate_asset_group_signals = ::Gapic::Config::Method.new mutate_asset_group_signals_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_signal_service/credentials.rb b/lib/google/ads/google_ads/v16/services/asset_group_signal_service/credentials.rb new file mode 100644 index 000000000..7ff498741 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_signal_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupSignalService + # Credentials for the AssetGroupSignalService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_signal_service/paths.rb b/lib/google/ads/google_ads/v16/services/asset_group_signal_service/paths.rb new file mode 100644 index 000000000..9ff9ae052 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_signal_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupSignalService + # Path helper methods for the AssetGroupSignalService API. + module Paths + ## + # Create a fully-qualified AssetGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroups/{asset_group_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # + # @return [::String] + def asset_group_path customer_id:, asset_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroups/#{asset_group_id}" + end + + ## + # Create a fully-qualified AssetGroupSignal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupSignals/{asset_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def asset_group_signal_path customer_id:, asset_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupSignals/#{asset_group_id}~#{criterion_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_signal_service_pb.rb b/lib/google/ads/google_ads/v16/services/asset_group_signal_service_pb.rb new file mode 100644 index 000000000..22d71ee92 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_signal_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/asset_group_signal_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/policy_pb' +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/asset_group_signal_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/services/asset_group_signal_service.proto\x12!google.ads.googleads.v16.services\x1a,google/ads/googleads/v16/common/policy.proto\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a;google/ads/googleads/v16/resources/asset_group_signal.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xad\x02\n\x1eMutateAssetGroupSignalsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12U\n\noperations\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.AssetGroupSignalOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x92\x02\n\x19\x41ssetGroupSignalOperation\x12^\n\x1c\x65xempt_policy_violation_keys\x18\x03 \x03(\x0b\x32\x33.google.ads.googleads.v16.common.PolicyViolationKeyB\x03\xe0\x41\x01\x12\x46\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.AssetGroupSignalH\x00\x12@\n\x06remove\x18\x02 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/AssetGroupSignalH\x00\x42\x0b\n\toperation\"\xa6\x01\n\x1fMutateAssetGroupSignalsResponse\x12P\n\x07results\x18\x01 \x03(\x0b\x32?.google.ads.googleads.v16.services.MutateAssetGroupSignalResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xb7\x01\n\x1cMutateAssetGroupSignalResult\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/AssetGroupSignal\x12P\n\x12\x61sset_group_signal\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.AssetGroupSignal2\xe0\x02\n\x17\x41ssetGroupSignalService\x12\xfd\x01\n\x17MutateAssetGroupSignals\x12\x41.google.ads.googleads.v16.services.MutateAssetGroupSignalsRequest\x1a\x42.google.ads.googleads.v16.services.MutateAssetGroupSignalsResponse\"[\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02<\"7/v16/customers/{customer_id=*}/assetGroupSignals:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x88\x02\n%com.google.ads.googleads.v16.servicesB\x1c\x41ssetGroupSignalServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.PolicyViolationKey", "google/ads/googleads/v16/common/policy.proto"], + ["google.ads.googleads.v16.resources.AssetGroupSignal", "google/ads/googleads/v16/resources/asset_group_signal.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAssetGroupSignalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupSignalsRequest").msgclass + AssetGroupSignalOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AssetGroupSignalOperation").msgclass + MutateAssetGroupSignalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupSignalsResponse").msgclass + MutateAssetGroupSignalResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetGroupSignalResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_group_signal_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/asset_group_signal_service_services_pb.rb new file mode 100644 index 000000000..8e8120e8e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_group_signal_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/asset_group_signal_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/asset_group_signal_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetGroupSignalService + # Proto file describing the AssetGroupSignal service. + # + # Service to manage asset group signal. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AssetGroupSignalService' + + # Creates or removes asset group signals. Operation statuses are + # returned. + rpc :MutateAssetGroupSignals, ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAssetGroupSignalsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_service.rb b/lib/google/ads/google_ads/v16/services/asset_service.rb new file mode 100644 index 000000000..8139c891e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_service.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/asset_service/credentials" +require "google/ads/google_ads/v16/services/asset_service/paths" +require "google/ads/google_ads/v16/services/asset_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage assets. Asset types can be created with AssetService are + # YoutubeVideoAsset, MediaBundleAsset and ImageAsset. TextAsset should be + # created with Ad inline. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/asset_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AssetService::Client.new + # + module AssetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "asset_service", "helpers.rb" +require "google/ads/google_ads/v16/services/asset_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/asset_service/client.rb b/lib/google/ads/google_ads/v16/services/asset_service/client.rb new file mode 100644 index 000000000..7b9be52d2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_service/client.rb @@ -0,0 +1,467 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/asset_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetService + ## + # Client for the AssetService service. + # + # Service to manage assets. Asset types can be created with AssetService are + # YoutubeVideoAsset, MediaBundleAsset and ImageAsset. TextAsset should be + # created with Ad inline. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :asset_service_stub + + ## + # Configure the AssetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssetService clients + # ::Google::Ads::GoogleAds::V16::Services::AssetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @asset_service_stub.universe_domain + end + + ## + # Create a new AssetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/asset_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @asset_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AssetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates assets. Operation statuses are returned. + # + # List of thrown errors: + # [AssetError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CurrencyCodeError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MediaUploadError]() + # [MutateError]() + # [NotAllowlistedError]() + # [NotEmptyError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # [YoutubeVideoRegistrationError]() + # + # @overload mutate_assets(request, options = nil) + # Pass arguments to `mutate_assets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_assets(customer_id: nil, operations: nil, partial_failure: nil, response_content_type: nil, validate_only: nil) + # Pass arguments to `mutate_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose assets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AssetOperation, ::Hash>] + # Required. The list of operations to perform on individual assets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAssetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAssetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AssetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAssetsRequest.new + # + # # Call the mutate_assets method. + # result = client.mutate_assets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAssetsResponse. + # p result + # + def mutate_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAssetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_assets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @asset_service_stub.call_rpc :mutate_assets, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AssetService API. + # + # This class represents the configuration for AssetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AssetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_assets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AssetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_assets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AssetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_assets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AssetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_assets + + # @private + def initialize parent_rpcs = nil + mutate_assets_config = parent_rpcs.mutate_assets if parent_rpcs.respond_to? :mutate_assets + @mutate_assets = ::Gapic::Config::Method.new mutate_assets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_service/credentials.rb b/lib/google/ads/google_ads/v16/services/asset_service/credentials.rb new file mode 100644 index 000000000..05630f0ab --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetService + # Credentials for the AssetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_service/paths.rb b/lib/google/ads/google_ads/v16/services/asset_service/paths.rb new file mode 100644 index 000000000..bb61bb6f9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetService + # Path helper methods for the AssetService API. + module Paths + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified ConversionAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionActions/{conversion_action_id}` + # + # @param customer_id [String] + # @param conversion_action_id [String] + # + # @return [::String] + def conversion_action_path customer_id:, conversion_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionActions/#{conversion_action_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_service_pb.rb b/lib/google/ads/google_ads/v16/services/asset_service_pb.rb new file mode 100644 index 000000000..8e073b599 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/asset_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/asset_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n5google/ads/googleads/v16/services/asset_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a.google/ads/googleads/v16/resources/asset.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x97\x02\n\x13MutateAssetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\noperations\x18\x02 \x03(\x0b\x32\x31.google.ads.googleads.v16.services.AssetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x05 \x01(\x08\x12j\n\x15response_content_type\x18\x03 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xc8\x01\n\x0e\x41ssetOperation\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12;\n\x06\x63reate\x18\x01 \x01(\x0b\x32).google.ads.googleads.v16.resources.AssetH\x00\x12;\n\x06update\x18\x02 \x01(\x0b\x32).google.ads.googleads.v16.resources.AssetH\x00\x42\x0b\n\toperation\"\x90\x01\n\x14MutateAssetsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\x07results\x18\x02 \x03(\x0b\x32\x34.google.ads.googleads.v16.services.MutateAssetResult\"\x89\x01\n\x11MutateAssetResult\x12:\n\rresource_name\x18\x01 \x01(\tB#\xfa\x41 \n\x1egoogleads.googleapis.com/Asset\x12\x38\n\x05\x61sset\x18\x02 \x01(\x0b\x32).google.ads.googleads.v16.resources.Asset2\xa9\x02\n\x0c\x41ssetService\x12\xd1\x01\n\x0cMutateAssets\x12\x36.google.ads.googleads.v16.services.MutateAssetsRequest\x1a\x37.google.ads.googleads.v16.services.MutateAssetsResponse\"P\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x31\",/v16/customers/{customer_id=*}/assets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\xfd\x01\n%com.google.ads.googleads.v16.servicesB\x11\x41ssetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.Asset", "google/ads/googleads/v16/resources/asset.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetsRequest").msgclass + AssetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AssetOperation").msgclass + MutateAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetsResponse").msgclass + MutateAssetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/asset_service_services_pb.rb new file mode 100644 index 000000000..fc9ba79b9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_service_services_pb.rb @@ -0,0 +1,80 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/asset_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/asset_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetService + # Proto file describing the Asset service. + # + # Service to manage assets. Asset types can be created with AssetService are + # YoutubeVideoAsset, MediaBundleAsset and ImageAsset. TextAsset should be + # created with Ad inline. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AssetService' + + # Creates assets. Operation statuses are returned. + # + # List of thrown errors: + # [AssetError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CurrencyCodeError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MediaUploadError]() + # [MutateError]() + # [NotAllowlistedError]() + # [NotEmptyError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # [YoutubeVideoRegistrationError]() + rpc :MutateAssets, ::Google::Ads::GoogleAds::V16::Services::MutateAssetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAssetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_asset_service.rb b/lib/google/ads/google_ads/v16/services/asset_set_asset_service.rb new file mode 100644 index 000000000..827fb4c9c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_asset_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/asset_set_asset_service/credentials" +require "google/ads/google_ads/v16/services/asset_set_asset_service/paths" +require "google/ads/google_ads/v16/services/asset_set_asset_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage asset set asset. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/asset_set_asset_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client.new + # + module AssetSetAssetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "asset_set_asset_service", "helpers.rb" +require "google/ads/google_ads/v16/services/asset_set_asset_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/asset_set_asset_service/client.rb b/lib/google/ads/google_ads/v16/services/asset_set_asset_service/client.rb new file mode 100644 index 000000000..d368faa8a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_asset_service/client.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/asset_set_asset_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetSetAssetService + ## + # Client for the AssetSetAssetService service. + # + # Service to manage asset set asset. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :asset_set_asset_service_stub + + ## + # Configure the AssetSetAssetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssetSetAssetService clients + # ::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssetSetAssetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @asset_set_asset_service_stub.universe_domain + end + + ## + # Create a new AssetSetAssetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssetSetAssetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/asset_set_asset_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @asset_set_asset_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes asset set assets. Operation statuses are + # returned. + # + # @overload mutate_asset_set_assets(request, options = nil) + # Pass arguments to `mutate_asset_set_assets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_asset_set_assets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_asset_set_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose asset set assets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AssetSetAssetOperation, ::Hash>] + # Required. The list of operations to perform on individual asset set assets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsRequest.new + # + # # Call the mutate_asset_set_assets method. + # result = client.mutate_asset_set_assets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsResponse. + # p result + # + def mutate_asset_set_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_asset_set_assets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_asset_set_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_asset_set_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @asset_set_asset_service_stub.call_rpc :mutate_asset_set_assets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AssetSetAssetService API. + # + # This class represents the configuration for AssetSetAssetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_asset_set_assets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_set_assets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_set_assets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AssetSetAssetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_asset_set_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_asset_set_assets + + # @private + def initialize parent_rpcs = nil + mutate_asset_set_assets_config = parent_rpcs.mutate_asset_set_assets if parent_rpcs.respond_to? :mutate_asset_set_assets + @mutate_asset_set_assets = ::Gapic::Config::Method.new mutate_asset_set_assets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_asset_service/credentials.rb b/lib/google/ads/google_ads/v16/services/asset_set_asset_service/credentials.rb new file mode 100644 index 000000000..733ac60a8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_asset_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetSetAssetService + # Credentials for the AssetSetAssetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_asset_service/paths.rb b/lib/google/ads/google_ads/v16/services/asset_set_asset_service/paths.rb new file mode 100644 index 000000000..00be1fee3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_asset_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetSetAssetService + # Path helper methods for the AssetSetAssetService API. + module Paths + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified AssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSets/#{asset_set_id}" + end + + ## + # Create a fully-qualified AssetSetAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSetAssets/{asset_set_id}~{asset_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_set_asset_path customer_id:, asset_set_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_set_id cannot contain /" if asset_set_id.to_s.include? "/" + + "customers/#{customer_id}/assetSetAssets/#{asset_set_id}~#{asset_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_asset_service_pb.rb b/lib/google/ads/google_ads/v16/services/asset_set_asset_service_pb.rb new file mode 100644 index 000000000..efc8314a7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_asset_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/asset_set_asset_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/asset_set_asset_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/services/asset_set_asset_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x38google/ads/googleads/v16/resources/asset_set_asset.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xa7\x02\n\x1bMutateAssetSetAssetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\noperations\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.AssetSetAssetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xa9\x01\n\x16\x41ssetSetAssetOperation\x12\x43\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.AssetSetAssetH\x00\x12=\n\x06remove\x18\x02 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/AssetSetAssetH\x00\x42\x0b\n\toperation\"\xa0\x01\n\x1cMutateAssetSetAssetsResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.ads.googleads.v16.services.MutateAssetSetAssetResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xab\x01\n\x19MutateAssetSetAssetResult\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/AssetSetAsset\x12J\n\x0f\x61sset_set_asset\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.AssetSetAsset2\xd1\x02\n\x14\x41ssetSetAssetService\x12\xf1\x01\n\x14MutateAssetSetAssets\x12>.google.ads.googleads.v16.services.MutateAssetSetAssetsRequest\x1a?.google.ads.googleads.v16.services.MutateAssetSetAssetsResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/assetSetAssets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x85\x02\n%com.google.ads.googleads.v16.servicesB\x19\x41ssetSetAssetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.AssetSetAsset", "google/ads/googleads/v16/resources/asset_set_asset.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAssetSetAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetSetAssetsRequest").msgclass + AssetSetAssetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AssetSetAssetOperation").msgclass + MutateAssetSetAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetSetAssetsResponse").msgclass + MutateAssetSetAssetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetSetAssetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_asset_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/asset_set_asset_service_services_pb.rb new file mode 100644 index 000000000..414f9b288 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_asset_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/asset_set_asset_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/asset_set_asset_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetSetAssetService + # Proto file describing the AssetSetAsset service. + # + # Service to manage asset set asset. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AssetSetAssetService' + + # Creates, updates or removes asset set assets. Operation statuses are + # returned. + rpc :MutateAssetSetAssets, ::Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAssetSetAssetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_service.rb b/lib/google/ads/google_ads/v16/services/asset_set_service.rb new file mode 100644 index 000000000..348ff6970 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/asset_set_service/credentials" +require "google/ads/google_ads/v16/services/asset_set_service/paths" +require "google/ads/google_ads/v16/services/asset_set_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage asset set + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/asset_set_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client.new + # + module AssetSetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "asset_set_service", "helpers.rb" +require "google/ads/google_ads/v16/services/asset_set_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/asset_set_service/client.rb b/lib/google/ads/google_ads/v16/services/asset_set_service/client.rb new file mode 100644 index 000000000..60e689f48 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_service/client.rb @@ -0,0 +1,437 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/asset_set_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetSetService + ## + # Client for the AssetSetService service. + # + # Service to manage asset set + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :asset_set_service_stub + + ## + # Configure the AssetSetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssetSetService clients + # ::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssetSetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @asset_set_service_stub.universe_domain + end + + ## + # Create a new AssetSetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssetSetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/asset_set_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @asset_set_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AssetSetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes asset sets. Operation statuses are + # returned. + # + # @overload mutate_asset_sets(request, options = nil) + # Pass arguments to `mutate_asset_sets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAssetSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAssetSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_asset_sets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_asset_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose asset sets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AssetSetOperation, ::Hash>] + # Required. The list of operations to perform on individual asset sets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAssetSetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAssetSetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AssetSetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAssetSetsRequest.new + # + # # Call the mutate_asset_sets method. + # result = client.mutate_asset_sets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAssetSetsResponse. + # p result + # + def mutate_asset_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAssetSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_asset_sets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_asset_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_asset_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @asset_set_service_stub.call_rpc :mutate_asset_sets, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AssetSetService API. + # + # This class represents the configuration for AssetSetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_asset_sets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_sets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AssetSetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_asset_sets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AssetSetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_asset_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_asset_sets + + # @private + def initialize parent_rpcs = nil + mutate_asset_sets_config = parent_rpcs.mutate_asset_sets if parent_rpcs.respond_to? :mutate_asset_sets + @mutate_asset_sets = ::Gapic::Config::Method.new mutate_asset_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_service/credentials.rb b/lib/google/ads/google_ads/v16/services/asset_set_service/credentials.rb new file mode 100644 index 000000000..70e94d75a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetSetService + # Credentials for the AssetSetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_service/paths.rb b/lib/google/ads/google_ads/v16/services/asset_set_service/paths.rb new file mode 100644 index 000000000..4f085d19e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetSetService + # Path helper methods for the AssetSetService API. + module Paths + ## + # Create a fully-qualified AssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSets/#{asset_set_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_service_pb.rb b/lib/google/ads/google_ads/v16/services/asset_set_service_pb.rb new file mode 100644 index 000000000..599dfede8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/asset_set_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/asset_set_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/services/asset_set_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x32google/ads/googleads/v16/resources/asset_set.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x9d\x02\n\x16MutateAssetSetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12M\n\noperations\x18\x02 \x03(\x0b\x32\x34.google.ads.googleads.v16.services.AssetSetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x8b\x02\n\x11\x41ssetSetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12>\n\x06\x63reate\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.AssetSetH\x00\x12>\n\x06update\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.AssetSetH\x00\x12\x38\n\x06remove\x18\x03 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/AssetSetH\x00\x42\x0b\n\toperation\"\x96\x01\n\x17MutateAssetSetsResponse\x12H\n\x07results\x18\x01 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.MutateAssetSetResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\x96\x01\n\x14MutateAssetSetResult\x12=\n\rresource_name\x18\x01 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/AssetSet\x12?\n\tasset_set\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.AssetSet2\xb8\x02\n\x0f\x41ssetSetService\x12\xdd\x01\n\x0fMutateAssetSets\x12\x39.google.ads.googleads.v16.services.MutateAssetSetsRequest\x1a:.google.ads.googleads.v16.services.MutateAssetSetsResponse\"S\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x34\"//v16/customers/{customer_id=*}/assetSets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x80\x02\n%com.google.ads.googleads.v16.servicesB\x14\x41ssetSetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AssetSet", "google/ads/googleads/v16/resources/asset_set.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAssetSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetSetsRequest").msgclass + AssetSetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AssetSetOperation").msgclass + MutateAssetSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetSetsResponse").msgclass + MutateAssetSetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAssetSetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/asset_set_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/asset_set_service_services_pb.rb new file mode 100644 index 000000000..50f949458 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/asset_set_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/asset_set_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/asset_set_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AssetSetService + # Proto file describing the AssetSet service. + # + # Service to manage asset set + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AssetSetService' + + # Creates, updates or removes asset sets. Operation statuses are + # returned. + rpc :MutateAssetSets, ::Google::Ads::GoogleAds::V16::Services::MutateAssetSetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAssetSetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_insights_service.rb b/lib/google/ads/google_ads/v16/services/audience_insights_service.rb new file mode 100644 index 000000000..9be560444 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_insights_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/audience_insights_service/credentials" +require "google/ads/google_ads/v16/services/audience_insights_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Audience Insights Service helps users find information about groups of + # people and how they can be reached with Google Ads. Accessible to + # allowlisted customers only. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/audience_insights_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new + # + module AudienceInsightsService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "audience_insights_service", "helpers.rb" +require "google/ads/google_ads/v16/services/audience_insights_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/audience_insights_service/client.rb b/lib/google/ads/google_ads/v16/services/audience_insights_service/client.rb new file mode 100644 index 000000000..6bd328548 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_insights_service/client.rb @@ -0,0 +1,890 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/audience_insights_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AudienceInsightsService + ## + # Client for the AudienceInsightsService service. + # + # Audience Insights Service helps users find information about groups of + # people and how they can be reached with Google Ads. Accessible to + # allowlisted customers only. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :audience_insights_service_stub + + ## + # Configure the AudienceInsightsService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AudienceInsightsService clients + # ::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AudienceInsightsService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @audience_insights_service_stub.universe_domain + end + + ## + # Create a new AudienceInsightsService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AudienceInsightsService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/audience_insights_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @audience_insights_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates a saved report that can be viewed in the Insights Finder tool. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # + # @overload generate_insights_finder_report(request, options = nil) + # Pass arguments to `generate_insights_finder_report` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_insights_finder_report(customer_id: nil, baseline_audience: nil, specific_audience: nil, customer_insights_group: nil) + # Pass arguments to `generate_insights_finder_report` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param baseline_audience [::Google::Ads::GoogleAds::V16::Services::BasicInsightsAudience, ::Hash] + # Required. A baseline audience for this report, typically all people in a + # region. + # @param specific_audience [::Google::Ads::GoogleAds::V16::Services::BasicInsightsAudience, ::Hash] + # Required. The specific audience of interest for this report. The insights + # in the report will be based on attributes more prevalent in this audience + # than in the report's baseline audience. + # @param customer_insights_group [::String] + # The name of the customer being planned for. This is a user-defined value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportRequest.new + # + # # Call the generate_insights_finder_report method. + # result = client.generate_insights_finder_report request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportResponse. + # p result + # + def generate_insights_finder_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_insights_finder_report.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_insights_finder_report.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_insights_finder_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @audience_insights_service_stub.call_rpc :generate_insights_finder_report, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Searches for audience attributes that can be used to generate insights. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # + # @overload list_audience_insights_attributes(request, options = nil) + # Pass arguments to `list_audience_insights_attributes` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_audience_insights_attributes(customer_id: nil, dimensions: nil, query_text: nil, customer_insights_group: nil, location_country_filters: nil) + # Pass arguments to `list_audience_insights_attributes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param dimensions [::Array<::Google::Ads::GoogleAds::V16::Enums::AudienceInsightsDimensionEnum::AudienceInsightsDimension>] + # Required. The types of attributes to be returned. + # @param query_text [::String] + # Required. A free text query. If the requested dimensions include + # Attributes CATEGORY or KNOWLEDGE_GRAPH, then the attributes returned for + # those dimensions will match or be related to this string. For other + # dimensions, this field is ignored and all available attributes are + # returned. + # @param customer_insights_group [::String] + # The name of the customer being planned for. This is a user-defined value. + # @param location_country_filters [::Array<::Google::Ads::GoogleAds::V16::Common::LocationInfo, ::Hash>] + # If SUB_COUNTRY_LOCATION attributes are one of the requested dimensions and + # this field is present, then the SUB_COUNTRY_LOCATION attributes returned + # will be located in these countries. If this field is absent, then location + # attributes are not filtered by country. Setting this field when + # SUB_COUNTRY_LOCATION attributes are not requested will return an error. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesRequest.new + # + # # Call the list_audience_insights_attributes method. + # result = client.list_audience_insights_attributes request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesResponse. + # p result + # + def list_audience_insights_attributes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_audience_insights_attributes.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_audience_insights_attributes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_audience_insights_attributes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @audience_insights_service_stub.call_rpc :list_audience_insights_attributes, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Lists date ranges for which audience insights data can be requested. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # + # @overload list_insights_eligible_dates(request, options = nil) + # Pass arguments to `list_insights_eligible_dates` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesRequest.new + # + # # Call the list_insights_eligible_dates method. + # result = client.list_insights_eligible_dates request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesResponse. + # p result + # + def list_insights_eligible_dates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_insights_eligible_dates.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_insights_eligible_dates.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_insights_eligible_dates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @audience_insights_service_stub.call_rpc :list_insights_eligible_dates, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns a collection of attributes that are represented in an audience of + # interest, with metrics that compare each attribute's share of the audience + # with its share of a baseline audience. + # + # List of thrown errors: + # [AudienceInsightsError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # + # @overload generate_audience_composition_insights(request, options = nil) + # Pass arguments to `generate_audience_composition_insights` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_audience_composition_insights(customer_id: nil, audience: nil, baseline_audience: nil, data_month: nil, dimensions: nil, customer_insights_group: nil) + # Pass arguments to `generate_audience_composition_insights` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param audience [::Google::Ads::GoogleAds::V16::Services::InsightsAudience, ::Hash] + # Required. The audience of interest for which insights are being requested. + # @param baseline_audience [::Google::Ads::GoogleAds::V16::Services::InsightsAudience, ::Hash] + # The baseline audience to which the audience of interest is being + # compared. + # @param data_month [::String] + # The one-month range of historical data to use for insights, in the format + # "yyyy-mm". If unset, insights will be returned for the last thirty days of + # data. + # @param dimensions [::Array<::Google::Ads::GoogleAds::V16::Enums::AudienceInsightsDimensionEnum::AudienceInsightsDimension>] + # Required. The audience dimensions for which composition insights should be + # returned. + # @param customer_insights_group [::String] + # The name of the customer being planned for. This is a user-defined value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsRequest.new + # + # # Call the generate_audience_composition_insights method. + # result = client.generate_audience_composition_insights request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsResponse. + # p result + # + def generate_audience_composition_insights request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_audience_composition_insights.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_audience_composition_insights.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_audience_composition_insights.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @audience_insights_service_stub.call_rpc :generate_audience_composition_insights, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns a collection of targeting insights (e.g. targetable audiences) that + # are relevant to the requested audience. + # + # List of thrown errors: + # [AudienceInsightsError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # + # @overload generate_suggested_targeting_insights(request, options = nil) + # Pass arguments to `generate_suggested_targeting_insights` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_suggested_targeting_insights(customer_id: nil, audience: nil, baseline_audience: nil, data_month: nil, customer_insights_group: nil) + # Pass arguments to `generate_suggested_targeting_insights` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param audience [::Google::Ads::GoogleAds::V16::Services::InsightsAudience, ::Hash] + # Required. The audience of interest for which insights are being requested. + # @param baseline_audience [::Google::Ads::GoogleAds::V16::Services::InsightsAudience, ::Hash] + # Optional. The baseline audience. The default, if unspecified, is all + # people in the same country as the audience of interest. + # @param data_month [::String] + # Optional. The one-month range of historical data to use for insights, in + # the format "yyyy-mm". If unset, insights will be returned for the last + # thirty days of data. + # @param customer_insights_group [::String] + # Optional. The name of the customer being planned for. This is a + # user-defined value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsRequest.new + # + # # Call the generate_suggested_targeting_insights method. + # result = client.generate_suggested_targeting_insights request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsResponse. + # p result + # + def generate_suggested_targeting_insights request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_suggested_targeting_insights.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_suggested_targeting_insights.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_suggested_targeting_insights.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @audience_insights_service_stub.call_rpc :generate_suggested_targeting_insights, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AudienceInsightsService API. + # + # This class represents the configuration for AudienceInsightsService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # generate_insights_finder_report to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.generate_insights_finder_report.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AudienceInsightsService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.generate_insights_finder_report.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AudienceInsightsService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `generate_insights_finder_report` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_insights_finder_report + ## + # RPC-specific configuration for `list_audience_insights_attributes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_audience_insights_attributes + ## + # RPC-specific configuration for `list_insights_eligible_dates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_insights_eligible_dates + ## + # RPC-specific configuration for `generate_audience_composition_insights` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_audience_composition_insights + ## + # RPC-specific configuration for `generate_suggested_targeting_insights` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_suggested_targeting_insights + + # @private + def initialize parent_rpcs = nil + generate_insights_finder_report_config = parent_rpcs.generate_insights_finder_report if parent_rpcs.respond_to? :generate_insights_finder_report + @generate_insights_finder_report = ::Gapic::Config::Method.new generate_insights_finder_report_config + list_audience_insights_attributes_config = parent_rpcs.list_audience_insights_attributes if parent_rpcs.respond_to? :list_audience_insights_attributes + @list_audience_insights_attributes = ::Gapic::Config::Method.new list_audience_insights_attributes_config + list_insights_eligible_dates_config = parent_rpcs.list_insights_eligible_dates if parent_rpcs.respond_to? :list_insights_eligible_dates + @list_insights_eligible_dates = ::Gapic::Config::Method.new list_insights_eligible_dates_config + generate_audience_composition_insights_config = parent_rpcs.generate_audience_composition_insights if parent_rpcs.respond_to? :generate_audience_composition_insights + @generate_audience_composition_insights = ::Gapic::Config::Method.new generate_audience_composition_insights_config + generate_suggested_targeting_insights_config = parent_rpcs.generate_suggested_targeting_insights if parent_rpcs.respond_to? :generate_suggested_targeting_insights + @generate_suggested_targeting_insights = ::Gapic::Config::Method.new generate_suggested_targeting_insights_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_insights_service/credentials.rb b/lib/google/ads/google_ads/v16/services/audience_insights_service/credentials.rb new file mode 100644 index 000000000..3d3d0d4ba --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_insights_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AudienceInsightsService + # Credentials for the AudienceInsightsService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_insights_service_pb.rb b/lib/google/ads/google_ads/v16/services/audience_insights_service_pb.rb new file mode 100644 index 000000000..b1bba61dd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_insights_service_pb.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/audience_insights_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/common/dates_pb' +require 'google/ads/google_ads/v16/enums/audience_insights_dimension_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/services/audience_insights_service.proto\x12!google.ads.googleads.v16.services\x1a.google/ads/googleads/v16/common/criteria.proto\x1a+google/ads/googleads/v16/common/dates.proto\x1a@google/ads/googleads/v16/enums/audience_insights_dimension.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"\x94\x02\n#GenerateInsightsFinderReportRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12X\n\x11\x62\x61seline_audience\x18\x02 \x01(\x0b\x32\x38.google.ads.googleads.v16.services.BasicInsightsAudienceB\x03\xe0\x41\x02\x12X\n\x11specific_audience\x18\x03 \x01(\x0b\x32\x38.google.ads.googleads.v16.services.BasicInsightsAudienceB\x03\xe0\x41\x02\x12\x1f\n\x17\x63ustomer_insights_group\x18\x04 \x01(\t\"@\n$GenerateInsightsFinderReportResponse\x12\x18\n\x10saved_report_url\x18\x01 \x01(\t\"\x89\x03\n*GenerateAudienceCompositionInsightsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\x08\x61udience\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.services.InsightsAudienceB\x03\xe0\x41\x02\x12N\n\x11\x62\x61seline_audience\x18\x06 \x01(\x0b\x32\x33.google.ads.googleads.v16.services.InsightsAudience\x12\x12\n\ndata_month\x18\x03 \x01(\t\x12p\n\ndimensions\x18\x04 \x03(\x0e\x32W.google.ads.googleads.v16.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimensionB\x03\xe0\x41\x02\x12\x1f\n\x17\x63ustomer_insights_group\x18\x05 \x01(\t\"~\n+GenerateAudienceCompositionInsightsResponse\x12O\n\x08sections\x18\x01 \x03(\x0b\x32=.google.ads.googleads.v16.services.AudienceCompositionSection\"\xa5\x02\n)GenerateSuggestedTargetingInsightsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\x08\x61udience\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.services.InsightsAudienceB\x03\xe0\x41\x02\x12S\n\x11\x62\x61seline_audience\x18\x03 \x01(\x0b\x32\x33.google.ads.googleads.v16.services.InsightsAudienceB\x03\xe0\x41\x01\x12\x17\n\ndata_month\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x63ustomer_insights_group\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x80\x01\n*GenerateSuggestedTargetingInsightsResponse\x12R\n\x0bsuggestions\x18\x01 \x03(\x0b\x32=.google.ads.googleads.v16.services.TargetingSuggestionMetrics\"\x95\x03\n\x1aTargetingSuggestionMetrics\x12W\n\tlocations\x18\x01 \x03(\x0b\x32\x44.google.ads.googleads.v16.services.AudienceInsightsAttributeMetadata\x12\x41\n\nage_ranges\x18\x02 \x03(\x0b\x32-.google.ads.googleads.v16.common.AgeRangeInfo\x12;\n\x06gender\x18\x03 \x01(\x0b\x32+.google.ads.googleads.v16.common.GenderInfo\x12\\\n\x0euser_interests\x18\x04 \x03(\x0b\x32\x44.google.ads.googleads.v16.services.AudienceInsightsAttributeMetadata\x12\x10\n\x08\x63overage\x18\x05 \x01(\x01\x12\r\n\x05index\x18\x06 \x01(\x01\x12\x1f\n\x17potential_youtube_reach\x18\x07 \x01(\x03\"\xbe\x02\n%ListAudienceInsightsAttributesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12p\n\ndimensions\x18\x02 \x03(\x0e\x32W.google.ads.googleads.v16.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimensionB\x03\xe0\x41\x02\x12\x17\n\nquery_text\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x17\x63ustomer_insights_group\x18\x04 \x01(\t\x12O\n\x18location_country_filters\x18\x05 \x03(\x0b\x32-.google.ads.googleads.v16.common.LocationInfo\"\x82\x01\n&ListAudienceInsightsAttributesResponse\x12X\n\nattributes\x18\x01 \x03(\x0b\x32\x44.google.ads.googleads.v16.services.AudienceInsightsAttributeMetadata\"\"\n ListInsightsEligibleDatesRequest\"~\n!ListInsightsEligibleDatesResponse\x12\x13\n\x0b\x64\x61ta_months\x18\x01 \x03(\t\x12\x44\n\x10last_thirty_days\x18\x02 \x01(\x0b\x32*.google.ads.googleads.v16.common.DateRange\"\x9e\x06\n\x19\x41udienceInsightsAttribute\x12\x42\n\tage_range\x18\x01 \x01(\x0b\x32-.google.ads.googleads.v16.common.AgeRangeInfoH\x00\x12=\n\x06gender\x18\x02 \x01(\x0b\x32+.google.ads.googleads.v16.common.GenderInfoH\x00\x12\x41\n\x08location\x18\x03 \x01(\x0b\x32-.google.ads.googleads.v16.common.LocationInfoH\x00\x12J\n\ruser_interest\x18\x04 \x01(\x0b\x32\x31.google.ads.googleads.v16.common.UserInterestInfoH\x00\x12K\n\x06\x65ntity\x18\x05 \x01(\x0b\x32\x39.google.ads.googleads.v16.services.AudienceInsightsEntityH\x00\x12O\n\x08\x63\x61tegory\x18\x06 \x01(\x0b\x32;.google.ads.googleads.v16.services.AudienceInsightsCategoryH\x00\x12Z\n\x0e\x64ynamic_lineup\x18\x07 \x01(\x0b\x32@.google.ads.googleads.v16.services.AudienceInsightsDynamicLineupH\x00\x12N\n\x0fparental_status\x18\x08 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.ParentalStatusInfoH\x00\x12H\n\x0cincome_range\x18\t \x01(\x0b\x32\x30.google.ads.googleads.v16.common.IncomeRangeInfoH\x00\x12N\n\x0fyoutube_channel\x18\n \x01(\x0b\x32\x33.google.ads.googleads.v16.common.YouTubeChannelInfoH\x00\x42\x0b\n\tattribute\"\xbe\x01\n\x15\x41udienceInsightsTopic\x12K\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.services.AudienceInsightsEntityH\x00\x12O\n\x08\x63\x61tegory\x18\x02 \x01(\x0b\x32;.google.ads.googleads.v16.services.AudienceInsightsCategoryH\x00\x42\x07\n\x05topic\"A\n\x16\x41udienceInsightsEntity\x12\'\n\x1aknowledge_graph_machine_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"4\n\x18\x41udienceInsightsCategory\x12\x18\n\x0b\x63\x61tegory_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"?\n\x1d\x41udienceInsightsDynamicLineup\x12\x1e\n\x11\x64ynamic_lineup_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xc8\x03\n\x15\x42\x61sicInsightsAudience\x12L\n\x10\x63ountry_location\x18\x01 \x03(\x0b\x32-.google.ads.googleads.v16.common.LocationInfoB\x03\xe0\x41\x02\x12L\n\x15sub_country_locations\x18\x02 \x03(\x0b\x32-.google.ads.googleads.v16.common.LocationInfo\x12;\n\x06gender\x18\x03 \x01(\x0b\x32+.google.ads.googleads.v16.common.GenderInfo\x12\x41\n\nage_ranges\x18\x04 \x03(\x0b\x32-.google.ads.googleads.v16.common.AgeRangeInfo\x12I\n\x0euser_interests\x18\x05 \x03(\x0b\x32\x31.google.ads.googleads.v16.common.UserInterestInfo\x12H\n\x06topics\x18\x06 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.AudienceInsightsTopic\"\xd8\x04\n!AudienceInsightsAttributeMetadata\x12j\n\tdimension\x18\x01 \x01(\x0e\x32W.google.ads.googleads.v16.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension\x12O\n\tattribute\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.services.AudienceInsightsAttribute\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_info\x18\x05 \x01(\t\x12\x66\n\x18youtube_channel_metadata\x18\x06 \x01(\x0b\x32\x42.google.ads.googleads.v16.services.YouTubeChannelAttributeMetadataH\x00\x12g\n\x1a\x64ynamic_attribute_metadata\x18\x07 \x01(\x0b\x32\x41.google.ads.googleads.v16.services.DynamicLineupAttributeMetadataH\x00\x12\x63\n\x1blocation_attribute_metadata\x18\x08 \x01(\x0b\x32<.google.ads.googleads.v16.services.LocationAttributeMetadataH\x00\x42\x14\n\x12\x64imension_metadata\";\n\x1fYouTubeChannelAttributeMetadata\x12\x18\n\x10subscriber_count\x18\x01 \x01(\x03\"\x80\x05\n\x1e\x44ynamicLineupAttributeMetadata\x12H\n\x11inventory_country\x18\x01 \x01(\x0b\x32-.google.ads.googleads.v16.common.LocationInfo\x12%\n\x18median_monthly_inventory\x18\x02 \x01(\x03H\x00\x88\x01\x01\x12&\n\x19\x63hannel_count_lower_bound\x18\x03 \x01(\x03H\x01\x88\x01\x01\x12&\n\x19\x63hannel_count_upper_bound\x18\x04 \x01(\x03H\x02\x88\x01\x01\x12h\n\x0fsample_channels\x18\x05 \x03(\x0b\x32O.google.ads.googleads.v16.services.DynamicLineupAttributeMetadata.SampleChannel\x1a\xd9\x01\n\rSampleChannel\x12L\n\x0fyoutube_channel\x18\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.YouTubeChannelInfo\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x64\n\x18youtube_channel_metadata\x18\x03 \x01(\x0b\x32\x42.google.ads.googleads.v16.services.YouTubeChannelAttributeMetadataB\x1b\n\x19_median_monthly_inventoryB\x1c\n\x1a_channel_count_lower_boundB\x1c\n\x1a_channel_count_upper_bound\"d\n\x19LocationAttributeMetadata\x12G\n\x10\x63ountry_location\x18\x01 \x01(\x0b\x32-.google.ads.googleads.v16.common.LocationInfo\"\x89\x05\n\x10InsightsAudience\x12M\n\x11\x63ountry_locations\x18\x01 \x03(\x0b\x32-.google.ads.googleads.v16.common.LocationInfoB\x03\xe0\x41\x02\x12L\n\x15sub_country_locations\x18\x02 \x03(\x0b\x32-.google.ads.googleads.v16.common.LocationInfo\x12;\n\x06gender\x18\x03 \x01(\x0b\x32+.google.ads.googleads.v16.common.GenderInfo\x12\x41\n\nage_ranges\x18\x04 \x03(\x0b\x32-.google.ads.googleads.v16.common.AgeRangeInfo\x12L\n\x0fparental_status\x18\x05 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.ParentalStatusInfo\x12G\n\rincome_ranges\x18\x06 \x03(\x0b\x32\x30.google.ads.googleads.v16.common.IncomeRangeInfo\x12Y\n\x0f\x64ynamic_lineups\x18\x07 \x03(\x0b\x32@.google.ads.googleads.v16.services.AudienceInsightsDynamicLineup\x12\x66\n\x1btopic_audience_combinations\x18\x08 \x03(\x0b\x32\x41.google.ads.googleads.v16.services.InsightsAudienceAttributeGroup\"w\n\x1eInsightsAudienceAttributeGroup\x12U\n\nattributes\x18\x01 \x03(\x0b\x32<.google.ads.googleads.v16.services.AudienceInsightsAttributeB\x03\xe0\x41\x02\"\xc7\x02\n\x1a\x41udienceCompositionSection\x12j\n\tdimension\x18\x01 \x01(\x0e\x32W.google.ads.googleads.v16.enums.AudienceInsightsDimensionEnum.AudienceInsightsDimension\x12W\n\x0etop_attributes\x18\x03 \x03(\x0b\x32?.google.ads.googleads.v16.services.AudienceCompositionAttribute\x12\x64\n\x14\x63lustered_attributes\x18\x04 \x03(\x0b\x32\x46.google.ads.googleads.v16.services.AudienceCompositionAttributeCluster\"\xf0\x01\n#AudienceCompositionAttributeCluster\x12\x1c\n\x14\x63luster_display_name\x18\x01 \x01(\t\x12V\n\x0f\x63luster_metrics\x18\x03 \x01(\x0b\x32=.google.ads.googleads.v16.services.AudienceCompositionMetrics\x12S\n\nattributes\x18\x04 \x03(\x0b\x32?.google.ads.googleads.v16.services.AudienceCompositionAttribute\"s\n\x1a\x41udienceCompositionMetrics\x12\x1f\n\x17\x62\x61seline_audience_share\x18\x01 \x01(\x01\x12\x16\n\x0e\x61udience_share\x18\x02 \x01(\x01\x12\r\n\x05index\x18\x03 \x01(\x01\x12\r\n\x05score\x18\x04 \x01(\x01\"\xd0\x01\n\x1c\x41udienceCompositionAttribute\x12`\n\x12\x61ttribute_metadata\x18\x01 \x01(\x0b\x32\x44.google.ads.googleads.v16.services.AudienceInsightsAttributeMetadata\x12N\n\x07metrics\x18\x02 \x01(\x0b\x32=.google.ads.googleads.v16.services.AudienceCompositionMetrics2\xfa\x0b\n\x17\x41udienceInsightsService\x12\xa9\x02\n\x1cGenerateInsightsFinderReport\x12\x46.google.ads.googleads.v16.services.GenerateInsightsFinderReportRequest\x1aG.google.ads.googleads.v16.services.GenerateInsightsFinderReportResponse\"x\xda\x41/customer_id,baseline_audience,specific_audience\x82\xd3\xe4\x93\x02@\";/v16/customers/{customer_id=*}:generateInsightsFinderReport:\x01*\x12\xa5\x02\n\x1eListAudienceInsightsAttributes\x12H.google.ads.googleads.v16.services.ListAudienceInsightsAttributesRequest\x1aI.google.ads.googleads.v16.services.ListAudienceInsightsAttributesResponse\"n\xda\x41!customer_id,dimensions,query_text\x82\xd3\xe4\x93\x02\x44\"?/v16/customers/{customer_id=*}:searchAudienceInsightsAttributes:\x01*\x12\xe2\x01\n\x19ListInsightsEligibleDates\x12\x43.google.ads.googleads.v16.services.ListInsightsEligibleDatesRequest\x1a\x44.google.ads.googleads.v16.services.ListInsightsEligibleDatesResponse\":\x82\xd3\xe4\x93\x02\x34\"//v16/audienceInsights:listInsightsEligibleDates:\x01*\x12\xb5\x02\n#GenerateAudienceCompositionInsights\x12M.google.ads.googleads.v16.services.GenerateAudienceCompositionInsightsRequest\x1aN.google.ads.googleads.v16.services.GenerateAudienceCompositionInsightsResponse\"o\xda\x41\x1f\x63ustomer_id,audience,dimensions\x82\xd3\xe4\x93\x02G\"B/v16/customers/{customer_id=*}:generateAudienceCompositionInsights:\x01*\x12\xa6\x02\n\"GenerateSuggestedTargetingInsights\x12L.google.ads.googleads.v16.services.GenerateSuggestedTargetingInsightsRequest\x1aM.google.ads.googleads.v16.services.GenerateSuggestedTargetingInsightsResponse\"c\xda\x41\x14\x63ustomer_id,audience\x82\xd3\xe4\x93\x02\x46\"A/v16/customers/{customer_id=*}:generateSuggestedTargetingInsights:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x88\x02\n%com.google.ads.googleads.v16.servicesB\x1c\x41udienceInsightsServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AgeRangeInfo", "google/ads/googleads/v16/common/criteria.proto"], + ["google.ads.googleads.v16.common.DateRange", "google/ads/googleads/v16/common/dates.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + GenerateInsightsFinderReportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateInsightsFinderReportRequest").msgclass + GenerateInsightsFinderReportResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateInsightsFinderReportResponse").msgclass + GenerateAudienceCompositionInsightsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateAudienceCompositionInsightsRequest").msgclass + GenerateAudienceCompositionInsightsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateAudienceCompositionInsightsResponse").msgclass + GenerateSuggestedTargetingInsightsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateSuggestedTargetingInsightsRequest").msgclass + GenerateSuggestedTargetingInsightsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateSuggestedTargetingInsightsResponse").msgclass + TargetingSuggestionMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.TargetingSuggestionMetrics").msgclass + ListAudienceInsightsAttributesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListAudienceInsightsAttributesRequest").msgclass + ListAudienceInsightsAttributesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListAudienceInsightsAttributesResponse").msgclass + ListInsightsEligibleDatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListInsightsEligibleDatesRequest").msgclass + ListInsightsEligibleDatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListInsightsEligibleDatesResponse").msgclass + AudienceInsightsAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceInsightsAttribute").msgclass + AudienceInsightsTopic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceInsightsTopic").msgclass + AudienceInsightsEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceInsightsEntity").msgclass + AudienceInsightsCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceInsightsCategory").msgclass + AudienceInsightsDynamicLineup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceInsightsDynamicLineup").msgclass + BasicInsightsAudience = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.BasicInsightsAudience").msgclass + AudienceInsightsAttributeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceInsightsAttributeMetadata").msgclass + YouTubeChannelAttributeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.YouTubeChannelAttributeMetadata").msgclass + DynamicLineupAttributeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.DynamicLineupAttributeMetadata").msgclass + DynamicLineupAttributeMetadata::SampleChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.DynamicLineupAttributeMetadata.SampleChannel").msgclass + LocationAttributeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.LocationAttributeMetadata").msgclass + InsightsAudience = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.InsightsAudience").msgclass + InsightsAudienceAttributeGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.InsightsAudienceAttributeGroup").msgclass + AudienceCompositionSection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceCompositionSection").msgclass + AudienceCompositionAttributeCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceCompositionAttributeCluster").msgclass + AudienceCompositionMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceCompositionMetrics").msgclass + AudienceCompositionAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceCompositionAttribute").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_insights_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/audience_insights_service_services_pb.rb new file mode 100644 index 000000000..7e0dbf476 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_insights_service_services_pb.rb @@ -0,0 +1,114 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/audience_insights_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/audience_insights_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AudienceInsightsService + # Proto file describing the audience insights service. + # + # Audience Insights Service helps users find information about groups of + # people and how they can be reached with Google Ads. Accessible to + # allowlisted customers only. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AudienceInsightsService' + + # Creates a saved report that can be viewed in the Insights Finder tool. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + rpc :GenerateInsightsFinderReport, ::Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateInsightsFinderReportResponse + # Searches for audience attributes that can be used to generate insights. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + rpc :ListAudienceInsightsAttributes, ::Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesRequest, ::Google::Ads::GoogleAds::V16::Services::ListAudienceInsightsAttributesResponse + # Lists date ranges for which audience insights data can be requested. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + rpc :ListInsightsEligibleDates, ::Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesRequest, ::Google::Ads::GoogleAds::V16::Services::ListInsightsEligibleDatesResponse + # Returns a collection of attributes that are represented in an audience of + # interest, with metrics that compare each attribute's share of the audience + # with its share of a baseline audience. + # + # List of thrown errors: + # [AudienceInsightsError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + rpc :GenerateAudienceCompositionInsights, ::Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateAudienceCompositionInsightsResponse + # Returns a collection of targeting insights (e.g. targetable audiences) that + # are relevant to the requested audience. + # + # List of thrown errors: + # [AudienceInsightsError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + rpc :GenerateSuggestedTargetingInsights, ::Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateSuggestedTargetingInsightsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_service.rb b/lib/google/ads/google_ads/v16/services/audience_service.rb new file mode 100644 index 000000000..85b5586c2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/audience_service/credentials" +require "google/ads/google_ads/v16/services/audience_service/paths" +require "google/ads/google_ads/v16/services/audience_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage audiences. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/audience_service" + # client = ::Google::Ads::GoogleAds::V16::Services::AudienceService::Client.new + # + module AudienceService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "audience_service", "helpers.rb" +require "google/ads/google_ads/v16/services/audience_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/audience_service/client.rb b/lib/google/ads/google_ads/v16/services/audience_service/client.rb new file mode 100644 index 000000000..4c9b214aa --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_service/client.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/audience_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AudienceService + ## + # Client for the AudienceService service. + # + # Service to manage audiences. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :audience_service_stub + + ## + # Configure the AudienceService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::AudienceService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AudienceService clients + # ::Google::Ads::GoogleAds::V16::Services::AudienceService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AudienceService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::AudienceService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @audience_service_stub.universe_domain + end + + ## + # Create a new AudienceService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AudienceService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::AudienceService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AudienceService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/audience_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @audience_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::AudienceService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates audiences. Operation statuses are returned. + # + # List of thrown errors: + # [AudienceError]() + # + # @overload mutate_audiences(request, options = nil) + # Pass arguments to `mutate_audiences` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateAudiencesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateAudiencesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_audiences(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_audiences` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose audiences are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::AudienceOperation, ::Hash>] + # Required. The list of operations to perform on individual audiences. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid operations + # will return errors. If false, all operations will be carried out in one + # transaction if and only if they are all valid. Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateAudiencesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateAudiencesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::AudienceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateAudiencesRequest.new + # + # # Call the mutate_audiences method. + # result = client.mutate_audiences request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateAudiencesResponse. + # p result + # + def mutate_audiences request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateAudiencesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_audiences.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_audiences.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_audiences.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @audience_service_stub.call_rpc :mutate_audiences, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the AudienceService API. + # + # This class represents the configuration for AudienceService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::AudienceService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_audiences to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::AudienceService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_audiences.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::AudienceService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_audiences.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AudienceService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_audiences` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_audiences + + # @private + def initialize parent_rpcs = nil + mutate_audiences_config = parent_rpcs.mutate_audiences if parent_rpcs.respond_to? :mutate_audiences + @mutate_audiences = ::Gapic::Config::Method.new mutate_audiences_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_service/credentials.rb b/lib/google/ads/google_ads/v16/services/audience_service/credentials.rb new file mode 100644 index 000000000..1b72aeb78 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AudienceService + # Credentials for the AudienceService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_service/paths.rb b/lib/google/ads/google_ads/v16/services/audience_service/paths.rb new file mode 100644 index 000000000..6fdef9c02 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_service/paths.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AudienceService + # Path helper methods for the AudienceService API. + module Paths + ## + # Create a fully-qualified AssetGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroups/{asset_group_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # + # @return [::String] + def asset_group_path customer_id:, asset_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroups/#{asset_group_id}" + end + + ## + # Create a fully-qualified Audience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/audiences/{audience_id}` + # + # @param customer_id [String] + # @param audience_id [String] + # + # @return [::String] + def audience_path customer_id:, audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/audiences/#{audience_id}" + end + + ## + # Create a fully-qualified DetailedDemographic resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/detailedDemographics/{detailed_demographic_id}` + # + # @param customer_id [String] + # @param detailed_demographic_id [String] + # + # @return [::String] + def detailed_demographic_path customer_id:, detailed_demographic_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/detailedDemographics/#{detailed_demographic_id}" + end + + ## + # Create a fully-qualified LifeEvent resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/lifeEvents/{life_event_id}` + # + # @param customer_id [String] + # @param life_event_id [String] + # + # @return [::String] + def life_event_path customer_id:, life_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/lifeEvents/#{life_event_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_service_pb.rb b/lib/google/ads/google_ads/v16/services/audience_service_pb.rb new file mode 100644 index 000000000..5cc7c22e8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/audience_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/audience_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/services/audience_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x31google/ads/googleads/v16/resources/audience.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x9d\x02\n\x16MutateAudiencesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12M\n\noperations\x18\x02 \x03(\x0b\x32\x34.google.ads.googleads.v16.services.AudienceOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x96\x01\n\x17MutateAudiencesResponse\x12H\n\x07results\x18\x01 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.MutateAudienceResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xd1\x01\n\x11\x41udienceOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12>\n\x06\x63reate\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.AudienceH\x00\x12>\n\x06update\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.AudienceH\x00\x42\x0b\n\toperation\"\x95\x01\n\x14MutateAudienceResult\x12=\n\rresource_name\x18\x01 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/Audience\x12>\n\x08\x61udience\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.Audience2\xb8\x02\n\x0f\x41udienceService\x12\xdd\x01\n\x0fMutateAudiences\x12\x39.google.ads.googleads.v16.services.MutateAudiencesRequest\x1a:.google.ads.googleads.v16.services.MutateAudiencesResponse\"S\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x34\"//v16/customers/{customer_id=*}/audiences:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x80\x02\n%com.google.ads.googleads.v16.servicesB\x14\x41udienceServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.Audience", "google/ads/googleads/v16/resources/audience.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateAudiencesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAudiencesRequest").msgclass + MutateAudiencesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAudiencesResponse").msgclass + AudienceOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceOperation").msgclass + MutateAudienceResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateAudienceResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/audience_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/audience_service_services_pb.rb new file mode 100644 index 000000000..37729251b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/audience_service_services_pb.rb @@ -0,0 +1,52 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/audience_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/audience_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module AudienceService + # Proto file describing the Audience service. + # + # Service to manage audiences. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.AudienceService' + + # Creates audiences. Operation statuses are returned. + # + # List of thrown errors: + # [AudienceError]() + rpc :MutateAudiences, ::Google::Ads::GoogleAds::V16::Services::MutateAudiencesRequest, ::Google::Ads::GoogleAds::V16::Services::MutateAudiencesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/batch_job_service.rb b/lib/google/ads/google_ads/v16/services/batch_job_service.rb new file mode 100644 index 000000000..60fc01028 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/batch_job_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/batch_job_service/credentials" +require "google/ads/google_ads/v16/services/batch_job_service/paths" +require "google/ads/google_ads/v16/services/batch_job_service/operations" +require "google/ads/google_ads/v16/services/batch_job_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage batch jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/batch_job_service" + # client = ::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.new + # + module BatchJobService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "batch_job_service", "helpers.rb" +require "google/ads/google_ads/v16/services/batch_job_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/batch_job_service/client.rb b/lib/google/ads/google_ads/v16/services/batch_job_service/client.rb new file mode 100644 index 000000000..d8e8b9416 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/batch_job_service/client.rb @@ -0,0 +1,806 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/batch_job_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BatchJobService + ## + # Client for the BatchJobService service. + # + # Service to manage batch jobs. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :batch_job_service_stub + + ## + # Configure the BatchJobService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BatchJobService clients + # ::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchJobService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @batch_job_service_stub.universe_domain + end + + ## + # Create a new BatchJobService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BatchJobService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/batch_job_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @batch_job_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::BatchJobService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Ads::GoogleAds::V16::Services::BatchJobService::Operations] + # + attr_reader :operations_client + + # Service calls + + ## + # Mutates a batch job. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # + # @overload mutate_batch_job(request, options = nil) + # Pass arguments to `mutate_batch_job` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateBatchJobRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateBatchJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_batch_job(customer_id: nil, operation: nil) + # Pass arguments to `mutate_batch_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer for which to create a batch job. + # @param operation [::Google::Ads::GoogleAds::V16::Services::BatchJobOperation, ::Hash] + # Required. The operation to perform on an individual batch job. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateBatchJobResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateBatchJobResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateBatchJobRequest.new + # + # # Call the mutate_batch_job method. + # result = client.mutate_batch_job request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateBatchJobResponse. + # p result + # + def mutate_batch_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateBatchJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_batch_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_batch_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_batch_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_job_service_stub.call_rpc :mutate_batch_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns the results of the batch job. The job must be done. + # Supports standard list paging. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [BatchJobError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload list_batch_job_results(request, options = nil) + # Pass arguments to `list_batch_job_results` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListBatchJobResultsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListBatchJobResultsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_batch_job_results(resource_name: nil, page_token: nil, page_size: nil, response_content_type: nil) + # Pass arguments to `list_batch_job_results` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The resource name of the batch job whose results are being + # listed. + # @param page_token [::String] + # Token of the page to retrieve. If not specified, the first + # page of results will be returned. Use the value obtained from + # `next_page_token` in the previous response in order to request + # the next page of results. + # @param page_size [::Integer] + # Number of elements to retrieve in a single page. + # When a page request is too large, the server may decide to + # further limit the number of returned resources. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Ads::GoogleAds::V16::Services::BatchJobResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Ads::GoogleAds::V16::Services::BatchJobResult>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListBatchJobResultsRequest.new + # + # # Call the list_batch_job_results method. + # result = client.list_batch_job_results request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Ads::GoogleAds::V16::Services::BatchJobResult. + # p item + # end + # + def list_batch_job_results request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListBatchJobResultsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_batch_job_results.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_batch_job_results.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_batch_job_results.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_job_service_stub.call_rpc :list_batch_job_results, request, + options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @batch_job_service_stub, :list_batch_job_results, request, + response, operation, options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Runs the batch job. + # + # The Operation.metadata field type is BatchJobMetadata. When finished, the + # long running operation will not contain errors or a response. Instead, use + # ListBatchJobResults to get the results of the job. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [BatchJobError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload run_batch_job(request, options = nil) + # Pass arguments to `run_batch_job` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::RunBatchJobRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::RunBatchJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_batch_job(resource_name: nil) + # Pass arguments to `run_batch_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The resource name of the BatchJob to run. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::RunBatchJobRequest.new + # + # # Call the run_batch_job method. + # result = client.run_batch_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def run_batch_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::RunBatchJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.run_batch_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_batch_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_batch_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_job_service_stub.call_rpc :run_batch_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Add operations to the batch job. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [BatchJobError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # + # @overload add_batch_job_operations(request, options = nil) + # Pass arguments to `add_batch_job_operations` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::AddBatchJobOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::AddBatchJobOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_batch_job_operations(resource_name: nil, sequence_token: nil, mutate_operations: nil) + # Pass arguments to `add_batch_job_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The resource name of the batch job. + # @param sequence_token [::String] + # A token used to enforce sequencing. + # + # The first AddBatchJobOperations request for a batch job should not set + # sequence_token. Subsequent requests must set sequence_token to the value of + # next_sequence_token received in the previous AddBatchJobOperations + # response. + # @param mutate_operations [::Array<::Google::Ads::GoogleAds::V16::Services::MutateOperation, ::Hash>] + # Required. The list of mutates being added. + # + # Operations can use negative integers as temp ids to signify dependencies + # between entities created in this batch job. For example, a customer with + # id = 1234 can create a campaign and an ad group in that same campaign by + # creating a campaign in the first operation with the resource name + # explicitly set to "customers/1234/campaigns/-1", and creating an ad group + # in the second operation with the campaign field also set to + # "customers/1234/campaigns/-1". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::AddBatchJobOperationsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::AddBatchJobOperationsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::AddBatchJobOperationsRequest.new + # + # # Call the add_batch_job_operations method. + # result = client.add_batch_job_operations request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::AddBatchJobOperationsResponse. + # p result + # + def add_batch_job_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::AddBatchJobOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_batch_job_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_batch_job_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_batch_job_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_job_service_stub.call_rpc :add_batch_job_operations, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the BatchJobService API. + # + # This class represents the configuration for BatchJobService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_batch_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_batch_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::BatchJobService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_batch_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BatchJobService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_batch_job` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_batch_job + ## + # RPC-specific configuration for `list_batch_job_results` + # @return [::Gapic::Config::Method] + # + attr_reader :list_batch_job_results + ## + # RPC-specific configuration for `run_batch_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_batch_job + ## + # RPC-specific configuration for `add_batch_job_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :add_batch_job_operations + + # @private + def initialize parent_rpcs = nil + mutate_batch_job_config = parent_rpcs.mutate_batch_job if parent_rpcs.respond_to? :mutate_batch_job + @mutate_batch_job = ::Gapic::Config::Method.new mutate_batch_job_config + list_batch_job_results_config = parent_rpcs.list_batch_job_results if parent_rpcs.respond_to? :list_batch_job_results + @list_batch_job_results = ::Gapic::Config::Method.new list_batch_job_results_config + run_batch_job_config = parent_rpcs.run_batch_job if parent_rpcs.respond_to? :run_batch_job + @run_batch_job = ::Gapic::Config::Method.new run_batch_job_config + add_batch_job_operations_config = parent_rpcs.add_batch_job_operations if parent_rpcs.respond_to? :add_batch_job_operations + @add_batch_job_operations = ::Gapic::Config::Method.new add_batch_job_operations_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/batch_job_service/credentials.rb b/lib/google/ads/google_ads/v16/services/batch_job_service/credentials.rb new file mode 100644 index 000000000..918b2a956 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/batch_job_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BatchJobService + # Credentials for the BatchJobService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/batch_job_service/operations.rb b/lib/google/ads/google_ads/v16/services/batch_job_service/operations.rb new file mode 100644 index 000000000..123291be5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/batch_job_service/operations.rb @@ -0,0 +1,813 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BatchJobService + # Service that implements Longrunning Operations API. + class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the BatchJobService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchJobService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, + operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/batch_job_service/paths.rb b/lib/google/ads/google_ads/v16/services/batch_job_service/paths.rb new file mode 100644 index 000000000..e24f7ffdb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/batch_job_service/paths.rb @@ -0,0 +1,1622 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BatchJobService + # Path helper methods for the BatchJobService API. + module Paths + ## + # Create a fully-qualified AccessibleBiddingStrategy resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accessibleBiddingStrategies/{bidding_strategy_id}` + # + # @param customer_id [String] + # @param bidding_strategy_id [String] + # + # @return [::String] + def accessible_bidding_strategy_path customer_id:, bidding_strategy_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accessibleBiddingStrategies/#{bidding_strategy_id}" + end + + ## + # Create a fully-qualified Ad resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/ads/{ad_id}` + # + # @param customer_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_path customer_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/ads/#{ad_id}" + end + + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupAd resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAds/{ad_group_id}~{ad_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_group_ad_path customer_id:, ad_group_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAds/#{ad_group_id}~#{ad_id}" + end + + ## + # Create a fully-qualified AdGroupAdLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAdLabels/{ad_group_id}~{ad_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_ad_label_path customer_id:, ad_group_id:, ad_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "ad_id cannot contain /" if ad_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAdLabels/#{ad_group_id}~#{ad_id}~#{label_id}" + end + + ## + # Create a fully-qualified AdGroupAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAssets/{ad_group_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def ad_group_asset_path customer_id:, ad_group_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAssets/#{ad_group_id}~#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified AdGroupBidModifier resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupBidModifiers/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_bid_modifier_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupBidModifiers/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdGroupCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_criterion_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriteria/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdGroupCriterionCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriterionCustomizers/{ad_group_id}~{criterion_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def ad_group_criterion_customizer_path customer_id:, ad_group_id:, criterion_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriterionCustomizers/#{ad_group_id}~#{criterion_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified AdGroupCriterionLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriterionLabels/{ad_group_id}~{criterion_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_criterion_label_path customer_id:, ad_group_id:, criterion_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriterionLabels/#{ad_group_id}~#{criterion_id}~#{label_id}" + end + + ## + # Create a fully-qualified AdGroupCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCustomizers/{ad_group_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def ad_group_customizer_path customer_id:, ad_group_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCustomizers/#{ad_group_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified AdGroupExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupExtensionSettings/{ad_group_id}~{extension_type}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param extension_type [String] + # + # @return [::String] + def ad_group_extension_setting_path customer_id:, ad_group_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupExtensionSettings/#{ad_group_id}~#{extension_type}" + end + + ## + # Create a fully-qualified AdGroupFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupFeeds/{ad_group_id}~{feed_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param feed_id [String] + # + # @return [::String] + def ad_group_feed_path customer_id:, ad_group_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupFeeds/#{ad_group_id}~#{feed_id}" + end + + ## + # Create a fully-qualified AdGroupLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupLabels/{ad_group_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_label_path customer_id:, ad_group_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupLabels/#{ad_group_id}~#{label_id}" + end + + ## + # Create a fully-qualified AdParameter resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adParameters/{ad_group_id}~{criterion_id}~{parameter_index}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param parameter_index [String] + # + # @return [::String] + def ad_parameter_path customer_id:, ad_group_id:, criterion_id:, parameter_index: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adParameters/#{ad_group_id}~#{criterion_id}~#{parameter_index}" + end + + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified AssetGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroups/{asset_group_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # + # @return [::String] + def asset_group_path customer_id:, asset_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroups/#{asset_group_id}" + end + + ## + # Create a fully-qualified AssetGroupAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupAssets/{asset_group_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def asset_group_asset_path customer_id:, asset_group_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupAssets/#{asset_group_id}~#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified AssetGroupListingGroupFilter resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupListingGroupFilters/{asset_group_id}~{listing_group_filter_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param listing_group_filter_id [String] + # + # @return [::String] + def asset_group_listing_group_filter_path customer_id:, asset_group_id:, listing_group_filter_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupListingGroupFilters/#{asset_group_id}~#{listing_group_filter_id}" + end + + ## + # Create a fully-qualified AssetGroupSignal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupSignals/{asset_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def asset_group_signal_path customer_id:, asset_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupSignals/#{asset_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSets/#{asset_set_id}" + end + + ## + # Create a fully-qualified AssetSetAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSetAssets/{asset_set_id}~{asset_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_set_asset_path customer_id:, asset_set_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_set_id cannot contain /" if asset_set_id.to_s.include? "/" + + "customers/#{customer_id}/assetSetAssets/#{asset_set_id}~#{asset_id}" + end + + ## + # Create a fully-qualified Audience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/audiences/{audience_id}` + # + # @param customer_id [String] + # @param audience_id [String] + # + # @return [::String] + def audience_path customer_id:, audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/audiences/#{audience_id}" + end + + ## + # Create a fully-qualified BatchJob resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/batchJobs/{batch_job_id}` + # + # @param customer_id [String] + # @param batch_job_id [String] + # + # @return [::String] + def batch_job_path customer_id:, batch_job_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/batchJobs/#{batch_job_id}" + end + + ## + # Create a fully-qualified BiddingDataExclusion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingDataExclusions/{seasonality_event_id}` + # + # @param customer_id [String] + # @param seasonality_event_id [String] + # + # @return [::String] + def bidding_data_exclusion_path customer_id:, seasonality_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingDataExclusions/#{seasonality_event_id}" + end + + ## + # Create a fully-qualified BiddingSeasonalityAdjustment resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingSeasonalityAdjustments/{seasonality_event_id}` + # + # @param customer_id [String] + # @param seasonality_event_id [String] + # + # @return [::String] + def bidding_seasonality_adjustment_path customer_id:, seasonality_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingSeasonalityAdjustments/#{seasonality_event_id}" + end + + ## + # Create a fully-qualified BiddingStrategy resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingStrategies/{bidding_strategy_id}` + # + # @param customer_id [String] + # @param bidding_strategy_id [String] + # + # @return [::String] + def bidding_strategy_path customer_id:, bidding_strategy_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingStrategies/#{bidding_strategy_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def campaign_asset_path customer_id:, campaign_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/campaignAssets/#{campaign_id}~#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified CampaignAssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignAssetSets/{campaign_id}~{asset_set_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def campaign_asset_set_path customer_id:, campaign_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignAssetSets/#{campaign_id}~#{asset_set_id}" + end + + ## + # Create a fully-qualified CampaignBidModifier resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBidModifiers/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def campaign_bid_modifier_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBidModifiers/#{campaign_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified CampaignBudget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBudgets/{campaign_budget_id}` + # + # @param customer_id [String] + # @param campaign_budget_id [String] + # + # @return [::String] + def campaign_budget_path customer_id:, campaign_budget_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBudgets/#{campaign_budget_id}" + end + + ## + # Create a fully-qualified CampaignConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignConversionGoals/{campaign_id}~{category}~{source}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param category [String] + # @param source [String] + # + # @return [::String] + def campaign_conversion_goal_path customer_id:, campaign_id:, category:, source: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "category cannot contain /" if category.to_s.include? "/" + + "customers/#{customer_id}/campaignConversionGoals/#{campaign_id}~#{category}~#{source}" + end + + ## + # Create a fully-qualified CampaignCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignCriteria/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def campaign_criterion_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignCriteria/#{campaign_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified CampaignCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignCustomizers/{campaign_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def campaign_customizer_path customer_id:, campaign_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignCustomizers/#{campaign_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified CampaignDraft resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignDrafts/{base_campaign_id}~{draft_id}` + # + # @param customer_id [String] + # @param base_campaign_id [String] + # @param draft_id [String] + # + # @return [::String] + def campaign_draft_path customer_id:, base_campaign_id:, draft_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "base_campaign_id cannot contain /" if base_campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignDrafts/#{base_campaign_id}~#{draft_id}" + end + + ## + # Create a fully-qualified CampaignExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignExtensionSettings/{campaign_id}~{extension_type}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param extension_type [String] + # + # @return [::String] + def campaign_extension_setting_path customer_id:, campaign_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignExtensionSettings/#{campaign_id}~#{extension_type}" + end + + ## + # Create a fully-qualified CampaignFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignFeeds/{campaign_id}~{feed_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param feed_id [String] + # + # @return [::String] + def campaign_feed_path customer_id:, campaign_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignFeeds/#{campaign_id}~#{feed_id}" + end + + ## + # Create a fully-qualified CampaignGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignGroups/{campaign_group_id}` + # + # @param customer_id [String] + # @param campaign_group_id [String] + # + # @return [::String] + def campaign_group_path customer_id:, campaign_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignGroups/#{campaign_group_id}" + end + + ## + # Create a fully-qualified CampaignLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignLabels/{campaign_id}~{label_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param label_id [String] + # + # @return [::String] + def campaign_label_path customer_id:, campaign_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignLabels/#{campaign_id}~#{label_id}" + end + + ## + # Create a fully-qualified CampaignSharedSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignSharedSets/{campaign_id}~{shared_set_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param shared_set_id [String] + # + # @return [::String] + def campaign_shared_set_path customer_id:, campaign_id:, shared_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignSharedSets/#{campaign_id}~#{shared_set_id}" + end + + ## + # Create a fully-qualified CarrierConstant resource string. + # + # The resource will be in the following format: + # + # `carrierConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def carrier_constant_path criterion_id: + "carrierConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified CombinedAudience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/combinedAudiences/{combined_audience_id}` + # + # @param customer_id [String] + # @param combined_audience_id [String] + # + # @return [::String] + def combined_audience_path customer_id:, combined_audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/combinedAudiences/#{combined_audience_id}" + end + + ## + # Create a fully-qualified ConversionAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionActions/{conversion_action_id}` + # + # @param customer_id [String] + # @param conversion_action_id [String] + # + # @return [::String] + def conversion_action_path customer_id:, conversion_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionActions/#{conversion_action_id}" + end + + ## + # Create a fully-qualified ConversionCustomVariable resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionCustomVariables/{conversion_custom_variable_id}` + # + # @param customer_id [String] + # @param conversion_custom_variable_id [String] + # + # @return [::String] + def conversion_custom_variable_path customer_id:, conversion_custom_variable_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionCustomVariables/#{conversion_custom_variable_id}" + end + + ## + # Create a fully-qualified ConversionGoalCampaignConfig resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionGoalCampaignConfigs/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def conversion_goal_campaign_config_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionGoalCampaignConfigs/#{campaign_id}" + end + + ## + # Create a fully-qualified ConversionValueRule resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionValueRules/{conversion_value_rule_id}` + # + # @param customer_id [String] + # @param conversion_value_rule_id [String] + # + # @return [::String] + def conversion_value_rule_path customer_id:, conversion_value_rule_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionValueRules/#{conversion_value_rule_id}" + end + + ## + # Create a fully-qualified ConversionValueRuleSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionValueRuleSets/{conversion_value_rule_set_id}` + # + # @param customer_id [String] + # @param conversion_value_rule_set_id [String] + # + # @return [::String] + def conversion_value_rule_set_path customer_id:, conversion_value_rule_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionValueRuleSets/#{conversion_value_rule_set_id}" + end + + ## + # Create a fully-qualified CustomConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customConversionGoals/{goal_id}` + # + # @param customer_id [String] + # @param goal_id [String] + # + # @return [::String] + def custom_conversion_goal_path customer_id:, goal_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customConversionGoals/#{goal_id}" + end + + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified CustomerAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerAssets/{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def customer_asset_path customer_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/customerAssets/#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified CustomerConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerConversionGoals/{category}~{source}` + # + # @param customer_id [String] + # @param category [String] + # @param source [String] + # + # @return [::String] + def customer_conversion_goal_path customer_id:, category:, source: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "category cannot contain /" if category.to_s.include? "/" + + "customers/#{customer_id}/customerConversionGoals/#{category}~#{source}" + end + + ## + # Create a fully-qualified CustomerCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerCustomizers/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customer_customizer_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerCustomizers/#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified CustomerExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerExtensionSettings/{extension_type}` + # + # @param customer_id [String] + # @param extension_type [String] + # + # @return [::String] + def customer_extension_setting_path customer_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerExtensionSettings/#{extension_type}" + end + + ## + # Create a fully-qualified CustomerFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerFeeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def customer_feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerFeeds/#{feed_id}" + end + + ## + # Create a fully-qualified CustomerLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerLabels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def customer_label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerLabels/#{label_id}" + end + + ## + # Create a fully-qualified CustomerNegativeCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerNegativeCriteria/{criterion_id}` + # + # @param customer_id [String] + # @param criterion_id [String] + # + # @return [::String] + def customer_negative_criterion_path customer_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerNegativeCriteria/#{criterion_id}" + end + + ## + # Create a fully-qualified CustomizerAttribute resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customizerAttributes/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customizer_attribute_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customizerAttributes/#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified DetailedDemographic resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/detailedDemographics/{detailed_demographic_id}` + # + # @param customer_id [String] + # @param detailed_demographic_id [String] + # + # @return [::String] + def detailed_demographic_path customer_id:, detailed_demographic_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/detailedDemographics/#{detailed_demographic_id}" + end + + ## + # Create a fully-qualified Experiment resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/experiments/{trial_id}` + # + # @param customer_id [String] + # @param trial_id [String] + # + # @return [::String] + def experiment_path customer_id:, trial_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/experiments/#{trial_id}" + end + + ## + # Create a fully-qualified ExperimentArm resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/experimentArms/{trial_id}~{trial_arm_id}` + # + # @param customer_id [String] + # @param trial_id [String] + # @param trial_arm_id [String] + # + # @return [::String] + def experiment_arm_path customer_id:, trial_id:, trial_arm_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "trial_id cannot contain /" if trial_id.to_s.include? "/" + + "customers/#{customer_id}/experimentArms/#{trial_id}~#{trial_arm_id}" + end + + ## + # Create a fully-qualified ExtensionFeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/extensionFeedItems/{feed_item_id}` + # + # @param customer_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def extension_feed_item_path customer_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/extensionFeedItems/#{feed_item_id}" + end + + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + ## + # Create a fully-qualified FeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def feed_item_path customer_id:, feed_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItems/#{feed_id}~#{feed_item_id}" + end + + ## + # Create a fully-qualified FeedItemSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemSets/{feed_id}~{feed_item_set_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_set_id [String] + # + # @return [::String] + def feed_item_set_path customer_id:, feed_id:, feed_item_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItemSets/#{feed_id}~#{feed_item_set_id}" + end + + ## + # Create a fully-qualified FeedItemSetLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemSetLinks/{feed_id}~{feed_item_set_id}~{feed_item_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_set_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def feed_item_set_link_path customer_id:, feed_id:, feed_item_set_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + raise ::ArgumentError, "feed_item_set_id cannot contain /" if feed_item_set_id.to_s.include? "/" + + "customers/#{customer_id}/feedItemSetLinks/#{feed_id}~#{feed_item_set_id}~#{feed_item_id}" + end + + ## + # Create a fully-qualified FeedItemTarget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemTargets/{feed_id}~{feed_item_id}~{feed_item_target_type}~{feed_item_target_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_id [String] + # @param feed_item_target_type [String] + # @param feed_item_target_id [String] + # + # @return [::String] + def feed_item_target_path customer_id:, feed_id:, feed_item_id:, feed_item_target_type:, + feed_item_target_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + raise ::ArgumentError, "feed_item_id cannot contain /" if feed_item_id.to_s.include? "/" + if feed_item_target_type.to_s.include? "/" + raise ::ArgumentError, + "feed_item_target_type cannot contain /" + end + + "customers/#{customer_id}/feedItemTargets/#{feed_id}~#{feed_item_id}~#{feed_item_target_type}~#{feed_item_target_id}" + end + + ## + # Create a fully-qualified FeedMapping resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedMappings/{feed_id}~{feed_mapping_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_mapping_id [String] + # + # @return [::String] + def feed_mapping_path customer_id:, feed_id:, feed_mapping_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedMappings/#{feed_id}~#{feed_mapping_id}" + end + + ## + # Create a fully-qualified GeoTargetConstant resource string. + # + # The resource will be in the following format: + # + # `geoTargetConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def geo_target_constant_path criterion_id: + "geoTargetConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified KeywordPlan resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlans/{keyword_plan_id}` + # + # @param customer_id [String] + # @param keyword_plan_id [String] + # + # @return [::String] + def keyword_plan_path customer_id:, keyword_plan_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlans/#{keyword_plan_id}" + end + + ## + # Create a fully-qualified KeywordPlanAdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanAdGroups/{keyword_plan_ad_group_id}` + # + # @param customer_id [String] + # @param keyword_plan_ad_group_id [String] + # + # @return [::String] + def keyword_plan_ad_group_path customer_id:, keyword_plan_ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanAdGroups/#{keyword_plan_ad_group_id}" + end + + ## + # Create a fully-qualified KeywordPlanAdGroupKeyword resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanAdGroupKeywords/{keyword_plan_ad_group_keyword_id}` + # + # @param customer_id [String] + # @param keyword_plan_ad_group_keyword_id [String] + # + # @return [::String] + def keyword_plan_ad_group_keyword_path customer_id:, keyword_plan_ad_group_keyword_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanAdGroupKeywords/#{keyword_plan_ad_group_keyword_id}" + end + + ## + # Create a fully-qualified KeywordPlanCampaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}` + # + # @param customer_id [String] + # @param keyword_plan_campaign_id [String] + # + # @return [::String] + def keyword_plan_campaign_path customer_id:, keyword_plan_campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanCampaigns/#{keyword_plan_campaign_id}" + end + + ## + # Create a fully-qualified KeywordPlanCampaignKeyword resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanCampaignKeywords/{keyword_plan_campaign_keyword_id}` + # + # @param customer_id [String] + # @param keyword_plan_campaign_keyword_id [String] + # + # @return [::String] + def keyword_plan_campaign_keyword_path customer_id:, keyword_plan_campaign_keyword_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanCampaignKeywords/#{keyword_plan_campaign_keyword_id}" + end + + ## + # Create a fully-qualified KeywordThemeConstant resource string. + # + # The resource will be in the following format: + # + # `keywordThemeConstants/{express_category_id}~{express_sub_category_id}` + # + # @param express_category_id [String] + # @param express_sub_category_id [String] + # + # @return [::String] + def keyword_theme_constant_path express_category_id:, express_sub_category_id: + raise ::ArgumentError, "express_category_id cannot contain /" if express_category_id.to_s.include? "/" + + "keywordThemeConstants/#{express_category_id}~#{express_sub_category_id}" + end + + ## + # Create a fully-qualified Label resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/labels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/labels/#{label_id}" + end + + ## + # Create a fully-qualified LanguageConstant resource string. + # + # The resource will be in the following format: + # + # `languageConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def language_constant_path criterion_id: + "languageConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified LifeEvent resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/lifeEvents/{life_event_id}` + # + # @param customer_id [String] + # @param life_event_id [String] + # + # @return [::String] + def life_event_path customer_id:, life_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/lifeEvents/#{life_event_id}" + end + + ## + # Create a fully-qualified MobileAppCategoryConstant resource string. + # + # The resource will be in the following format: + # + # `mobileAppCategoryConstants/{mobile_app_category_id}` + # + # @param mobile_app_category_id [String] + # + # @return [::String] + def mobile_app_category_constant_path mobile_app_category_id: + "mobileAppCategoryConstants/#{mobile_app_category_id}" + end + + ## + # Create a fully-qualified MobileDeviceConstant resource string. + # + # The resource will be in the following format: + # + # `mobileDeviceConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def mobile_device_constant_path criterion_id: + "mobileDeviceConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified OperatingSystemVersionConstant resource string. + # + # The resource will be in the following format: + # + # `operatingSystemVersionConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def operating_system_version_constant_path criterion_id: + "operatingSystemVersionConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified RecommendationSubscription resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/recommendationSubscriptions/{recommendation_type}` + # + # @param customer_id [String] + # @param recommendation_type [String] + # + # @return [::String] + def recommendation_subscription_path customer_id:, recommendation_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/recommendationSubscriptions/#{recommendation_type}" + end + + ## + # Create a fully-qualified RemarketingAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/remarketingActions/{remarketing_action_id}` + # + # @param customer_id [String] + # @param remarketing_action_id [String] + # + # @return [::String] + def remarketing_action_path customer_id:, remarketing_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/remarketingActions/#{remarketing_action_id}" + end + + ## + # Create a fully-qualified SharedCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}` + # + # @param customer_id [String] + # @param shared_set_id [String] + # @param criterion_id [String] + # + # @return [::String] + def shared_criterion_path customer_id:, shared_set_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "shared_set_id cannot contain /" if shared_set_id.to_s.include? "/" + + "customers/#{customer_id}/sharedCriteria/#{shared_set_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified SharedSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/sharedSets/{shared_set_id}` + # + # @param customer_id [String] + # @param shared_set_id [String] + # + # @return [::String] + def shared_set_path customer_id:, shared_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/sharedSets/#{shared_set_id}" + end + + ## + # Create a fully-qualified SmartCampaignSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/smartCampaignSettings/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def smart_campaign_setting_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/smartCampaignSettings/#{campaign_id}" + end + + ## + # Create a fully-qualified TopicConstant resource string. + # + # The resource will be in the following format: + # + # `topicConstants/{topic_id}` + # + # @param topic_id [String] + # + # @return [::String] + def topic_constant_path topic_id: + "topicConstants/#{topic_id}" + end + + ## + # Create a fully-qualified UserInterest resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userInterests/{user_interest_id}` + # + # @param customer_id [String] + # @param user_interest_id [String] + # + # @return [::String] + def user_interest_path customer_id:, user_interest_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/userInterests/#{user_interest_id}" + end + + ## + # Create a fully-qualified UserList resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userLists/{user_list_id}` + # + # @param customer_id [String] + # @param user_list_id [String] + # + # @return [::String] + def user_list_path customer_id:, user_list_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/userLists/#{user_list_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/batch_job_service_pb.rb b/lib/google/ads/google_ads/v16/services/batch_job_service_pb.rb new file mode 100644 index 000000000..14f3f4f0c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/batch_job_service_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/batch_job_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/batch_job_pb' +require 'google/ads/google_ads/v16/services/google_ads_service_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/services/batch_job_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x32google/ads/googleads/v16/resources/batch_job.proto\x1a:google/ads/googleads/v16/services/google_ads_service.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\"\x7f\n\x15MutateBatchJobRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\toperation\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.services.BatchJobOperationB\x03\xe0\x41\x02\"\x9a\x01\n\x11\x42\x61tchJobOperation\x12>\n\x06\x63reate\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.BatchJobH\x00\x12\x38\n\x06remove\x18\x04 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/BatchJobH\x00\x42\x0b\n\toperation\"a\n\x16MutateBatchJobResponse\x12G\n\x06result\x18\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.services.MutateBatchJobResult\"U\n\x14MutateBatchJobResult\x12=\n\rresource_name\x18\x01 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/BatchJob\"V\n\x12RunBatchJobRequest\x12@\n\rresource_name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!googleads.googleapis.com/BatchJob\"\xcc\x01\n\x1c\x41\x64\x64\x42\x61tchJobOperationsRequest\x12@\n\rresource_name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!googleads.googleapis.com/BatchJob\x12\x16\n\x0esequence_token\x18\x02 \x01(\t\x12R\n\x11mutate_operations\x18\x03 \x03(\x0b\x32\x32.google.ads.googleads.v16.services.MutateOperationB\x03\xe0\x41\x02\"V\n\x1d\x41\x64\x64\x42\x61tchJobOperationsResponse\x12\x18\n\x10total_operations\x18\x01 \x01(\x03\x12\x1b\n\x13next_sequence_token\x18\x02 \x01(\t\"\xf1\x01\n\x1aListBatchJobResultsRequest\x12@\n\rresource_name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!googleads.googleapis.com/BatchJob\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12j\n\x15response_content_type\x18\x04 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"z\n\x1bListBatchJobResultsResponse\x12\x42\n\x07results\x18\x01 \x03(\x0b\x32\x31.google.ads.googleads.v16.services.BatchJobResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xac\x01\n\x0e\x42\x61tchJobResult\x12\x17\n\x0foperation_index\x18\x01 \x01(\x03\x12]\n\x19mutate_operation_response\x18\x02 \x01(\x0b\x32:.google.ads.googleads.v16.services.MutateOperationResponse\x12\"\n\x06status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status2\xe1\x08\n\x0f\x42\x61tchJobService\x12\xd9\x01\n\x0eMutateBatchJob\x12\x38.google.ads.googleads.v16.services.MutateBatchJobRequest\x1a\x39.google.ads.googleads.v16.services.MutateBatchJobResponse\"R\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02\x34\"//v16/customers/{customer_id=*}/batchJobs:mutate:\x01*\x12\xe6\x01\n\x13ListBatchJobResults\x12=.google.ads.googleads.v16.services.ListBatchJobResultsRequest\x1a>.google.ads.googleads.v16.services.ListBatchJobResultsResponse\"P\xda\x41\rresource_name\x82\xd3\xe4\x93\x02:\x12\x38/v16/{resource_name=customers/*/batchJobs/*}:listResults\x12\x89\x02\n\x0bRunBatchJob\x12\x35.google.ads.googleads.v16.services.RunBatchJobRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41U\n\x15google.protobuf.Empty\x12] + # Required. The list of operations to perform on individual data exclusions. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateBiddingDataExclusionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateBiddingDataExclusionsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BiddingDataExclusionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateBiddingDataExclusionsRequest.new + # + # # Call the mutate_bidding_data_exclusions method. + # result = client.mutate_bidding_data_exclusions request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateBiddingDataExclusionsResponse. + # p result + # + def mutate_bidding_data_exclusions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateBiddingDataExclusionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_bidding_data_exclusions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_bidding_data_exclusions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_bidding_data_exclusions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @bidding_data_exclusion_service_stub.call_rpc :mutate_bidding_data_exclusions, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the BiddingDataExclusionService API. + # + # This class represents the configuration for BiddingDataExclusionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::BiddingDataExclusionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_bidding_data_exclusions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::BiddingDataExclusionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_bidding_data_exclusions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingDataExclusionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_bidding_data_exclusions.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BiddingDataExclusionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_bidding_data_exclusions` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_bidding_data_exclusions + + # @private + def initialize parent_rpcs = nil + mutate_bidding_data_exclusions_config = parent_rpcs.mutate_bidding_data_exclusions if parent_rpcs.respond_to? :mutate_bidding_data_exclusions + @mutate_bidding_data_exclusions = ::Gapic::Config::Method.new mutate_bidding_data_exclusions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service/credentials.rb b/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service/credentials.rb new file mode 100644 index 000000000..b4757e91a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingDataExclusionService + # Credentials for the BiddingDataExclusionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service/paths.rb b/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service/paths.rb new file mode 100644 index 000000000..a6a064349 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingDataExclusionService + # Path helper methods for the BiddingDataExclusionService API. + module Paths + ## + # Create a fully-qualified BiddingDataExclusion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingDataExclusions/{seasonality_event_id}` + # + # @param customer_id [String] + # @param seasonality_event_id [String] + # + # @return [::String] + def bidding_data_exclusion_path customer_id:, seasonality_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingDataExclusions/#{seasonality_event_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service_pb.rb b/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service_pb.rb new file mode 100644 index 000000000..a3b63fd5f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/bidding_data_exclusion_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/bidding_data_exclusion_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/services/bidding_data_exclusion_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a?google/ads/googleads/v16/resources/bidding_data_exclusion.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb5\x02\n\"MutateBiddingDataExclusionsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Y\n\noperations\x18\x02 \x03(\x0b\x32@.google.ads.googleads.v16.services.BiddingDataExclusionOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xbb\x02\n\x1d\x42iddingDataExclusionOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12J\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.BiddingDataExclusionH\x00\x12J\n\x06update\x18\x02 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.BiddingDataExclusionH\x00\x12\x44\n\x06remove\x18\x03 \x01(\tB2\xfa\x41/\n-googleads.googleapis.com/BiddingDataExclusionH\x00\x42\x0b\n\toperation\"\xaf\x01\n#MutateBiddingDataExclusionsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12U\n\x07results\x18\x02 \x03(\x0b\x32\x44.google.ads.googleads.v16.services.MutateBiddingDataExclusionsResult\"\xc8\x01\n!MutateBiddingDataExclusionsResult\x12I\n\rresource_name\x18\x01 \x01(\tB2\xfa\x41/\n-googleads.googleapis.com/BiddingDataExclusion\x12X\n\x16\x62idding_data_exclusion\x18\x02 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.BiddingDataExclusion2\xf4\x02\n\x1b\x42iddingDataExclusionService\x12\x8d\x02\n\x1bMutateBiddingDataExclusions\x12\x45.google.ads.googleads.v16.services.MutateBiddingDataExclusionsRequest\x1a\x46.google.ads.googleads.v16.services.MutateBiddingDataExclusionsResponse\"_\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02@\";/v16/customers/{customer_id=*}/biddingDataExclusions:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8c\x02\n%com.google.ads.googleads.v16.servicesB BiddingDataExclusionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.BiddingDataExclusion", "google/ads/googleads/v16/resources/bidding_data_exclusion.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateBiddingDataExclusionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingDataExclusionsRequest").msgclass + BiddingDataExclusionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.BiddingDataExclusionOperation").msgclass + MutateBiddingDataExclusionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingDataExclusionsResponse").msgclass + MutateBiddingDataExclusionsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingDataExclusionsResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service_services_pb.rb new file mode 100644 index 000000000..7c8282786 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_data_exclusion_service_services_pb.rb @@ -0,0 +1,48 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/bidding_data_exclusion_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/bidding_data_exclusion_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingDataExclusionService + # Service to manage bidding data exclusions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.BiddingDataExclusionService' + + # Creates, updates, or removes data exclusions. + # Operation statuses are returned. + rpc :MutateBiddingDataExclusions, ::Google::Ads::GoogleAds::V16::Services::MutateBiddingDataExclusionsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateBiddingDataExclusionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service.rb b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service.rb new file mode 100644 index 000000000..f05de3114 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/credentials" +require "google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/paths" +require "google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage bidding seasonality adjustments. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service" + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client.new + # + module BiddingSeasonalityAdjustmentService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "bidding_seasonality_adjustment_service", "helpers.rb" +require "google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/client.rb b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/client.rb new file mode 100644 index 000000000..8d7fe2dbb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingSeasonalityAdjustmentService + ## + # Client for the BiddingSeasonalityAdjustmentService service. + # + # Service to manage bidding seasonality adjustments. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :bidding_seasonality_adjustment_service_stub + + ## + # Configure the BiddingSeasonalityAdjustmentService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BiddingSeasonalityAdjustmentService clients + # ::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BiddingSeasonalityAdjustmentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @bidding_seasonality_adjustment_service_stub.universe_domain + end + + ## + # Create a new BiddingSeasonalityAdjustmentService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BiddingSeasonalityAdjustmentService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @bidding_seasonality_adjustment_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes seasonality adjustments. + # Operation statuses are returned. + # + # @overload mutate_bidding_seasonality_adjustments(request, options = nil) + # Pass arguments to `mutate_bidding_seasonality_adjustments` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_bidding_seasonality_adjustments(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_bidding_seasonality_adjustments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. ID of the customer whose seasonality adjustments are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentOperation, ::Hash>] + # Required. The list of operations to perform on individual seasonality + # adjustments. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsRequest.new + # + # # Call the mutate_bidding_seasonality_adjustments method. + # result = client.mutate_bidding_seasonality_adjustments request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsResponse. + # p result + # + def mutate_bidding_seasonality_adjustments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_bidding_seasonality_adjustments.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_bidding_seasonality_adjustments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_bidding_seasonality_adjustments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @bidding_seasonality_adjustment_service_stub.call_rpc :mutate_bidding_seasonality_adjustments, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the BiddingSeasonalityAdjustmentService API. + # + # This class represents the configuration for BiddingSeasonalityAdjustmentService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_bidding_seasonality_adjustments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_bidding_seasonality_adjustments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingSeasonalityAdjustmentService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_bidding_seasonality_adjustments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BiddingSeasonalityAdjustmentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_bidding_seasonality_adjustments` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_bidding_seasonality_adjustments + + # @private + def initialize parent_rpcs = nil + mutate_bidding_seasonality_adjustments_config = parent_rpcs.mutate_bidding_seasonality_adjustments if parent_rpcs.respond_to? :mutate_bidding_seasonality_adjustments + @mutate_bidding_seasonality_adjustments = ::Gapic::Config::Method.new mutate_bidding_seasonality_adjustments_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/credentials.rb b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/credentials.rb new file mode 100644 index 000000000..e33865e54 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingSeasonalityAdjustmentService + # Credentials for the BiddingSeasonalityAdjustmentService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/paths.rb b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/paths.rb new file mode 100644 index 000000000..85341c8cb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingSeasonalityAdjustmentService + # Path helper methods for the BiddingSeasonalityAdjustmentService API. + module Paths + ## + # Create a fully-qualified BiddingSeasonalityAdjustment resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingSeasonalityAdjustments/{seasonality_event_id}` + # + # @param customer_id [String] + # @param seasonality_event_id [String] + # + # @return [::String] + def bidding_seasonality_adjustment_path customer_id:, seasonality_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingSeasonalityAdjustments/#{seasonality_event_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_pb.rb b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_pb.rb new file mode 100644 index 000000000..f451aee76 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/bidding_seasonality_adjustment_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/bidding_seasonality_adjustment_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nNgoogle/ads/googleads/v16/services/bidding_seasonality_adjustment_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1aGgoogle/ads/googleads/v16/resources/bidding_seasonality_adjustment.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xc5\x02\n*MutateBiddingSeasonalityAdjustmentsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x61\n\noperations\x18\x02 \x03(\x0b\x32H.google.ads.googleads.v16.services.BiddingSeasonalityAdjustmentOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xdb\x02\n%BiddingSeasonalityAdjustmentOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12R\n\x06\x63reate\x18\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.BiddingSeasonalityAdjustmentH\x00\x12R\n\x06update\x18\x02 \x01(\x0b\x32@.google.ads.googleads.v16.resources.BiddingSeasonalityAdjustmentH\x00\x12L\n\x06remove\x18\x03 \x01(\tB:\xfa\x41\x37\n5googleads.googleapis.com/BiddingSeasonalityAdjustmentH\x00\x42\x0b\n\toperation\"\xbf\x01\n+MutateBiddingSeasonalityAdjustmentsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12]\n\x07results\x18\x02 \x03(\x0b\x32L.google.ads.googleads.v16.services.MutateBiddingSeasonalityAdjustmentsResult\"\xe8\x01\n)MutateBiddingSeasonalityAdjustmentsResult\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xfa\x41\x37\n5googleads.googleapis.com/BiddingSeasonalityAdjustment\x12h\n\x1e\x62idding_seasonality_adjustment\x18\x02 \x01(\x0b\x32@.google.ads.googleads.v16.resources.BiddingSeasonalityAdjustment2\x9c\x03\n#BiddingSeasonalityAdjustmentService\x12\xad\x02\n#MutateBiddingSeasonalityAdjustments\x12M.google.ads.googleads.v16.services.MutateBiddingSeasonalityAdjustmentsRequest\x1aN.google.ads.googleads.v16.services.MutateBiddingSeasonalityAdjustmentsResponse\"g\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02H\"C/v16/customers/{customer_id=*}/biddingSeasonalityAdjustments:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x94\x02\n%com.google.ads.googleads.v16.servicesB(BiddingSeasonalityAdjustmentServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.BiddingSeasonalityAdjustment", "google/ads/googleads/v16/resources/bidding_seasonality_adjustment.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateBiddingSeasonalityAdjustmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingSeasonalityAdjustmentsRequest").msgclass + BiddingSeasonalityAdjustmentOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.BiddingSeasonalityAdjustmentOperation").msgclass + MutateBiddingSeasonalityAdjustmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingSeasonalityAdjustmentsResponse").msgclass + MutateBiddingSeasonalityAdjustmentsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingSeasonalityAdjustmentsResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_services_pb.rb new file mode 100644 index 000000000..4660a92a3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_services_pb.rb @@ -0,0 +1,48 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/bidding_seasonality_adjustment_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/bidding_seasonality_adjustment_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingSeasonalityAdjustmentService + # Service to manage bidding seasonality adjustments. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.BiddingSeasonalityAdjustmentService' + + # Creates, updates, or removes seasonality adjustments. + # Operation statuses are returned. + rpc :MutateBiddingSeasonalityAdjustments, ::Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateBiddingSeasonalityAdjustmentsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_strategy_service.rb b/lib/google/ads/google_ads/v16/services/bidding_strategy_service.rb new file mode 100644 index 000000000..7f9b3545d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_strategy_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/bidding_strategy_service/credentials" +require "google/ads/google_ads/v16/services/bidding_strategy_service/paths" +require "google/ads/google_ads/v16/services/bidding_strategy_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage bidding strategies. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/bidding_strategy_service" + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client.new + # + module BiddingStrategyService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "bidding_strategy_service", "helpers.rb" +require "google/ads/google_ads/v16/services/bidding_strategy_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/bidding_strategy_service/client.rb b/lib/google/ads/google_ads/v16/services/bidding_strategy_service/client.rb new file mode 100644 index 000000000..e8a33cb2d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_strategy_service/client.rb @@ -0,0 +1,468 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/bidding_strategy_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingStrategyService + ## + # Client for the BiddingStrategyService service. + # + # Service to manage bidding strategies. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :bidding_strategy_service_stub + + ## + # Configure the BiddingStrategyService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BiddingStrategyService clients + # ::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BiddingStrategyService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @bidding_strategy_service_stub.universe_domain + end + + ## + # Create a new BiddingStrategyService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BiddingStrategyService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/bidding_strategy_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @bidding_strategy_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes bidding strategies. Operation statuses are + # returned. + # + # List of thrown errors: + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [BiddingStrategyError]() + # [ContextError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_bidding_strategies(request, options = nil) + # Pass arguments to `mutate_bidding_strategies` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_bidding_strategies(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_bidding_strategies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose bidding strategies are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::BiddingStrategyOperation, ::Hash>] + # Required. The list of operations to perform on individual bidding + # strategies. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesRequest.new + # + # # Call the mutate_bidding_strategies method. + # result = client.mutate_bidding_strategies request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesResponse. + # p result + # + def mutate_bidding_strategies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_bidding_strategies.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_bidding_strategies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_bidding_strategies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @bidding_strategy_service_stub.call_rpc :mutate_bidding_strategies, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the BiddingStrategyService API. + # + # This class represents the configuration for BiddingStrategyService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_bidding_strategies to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_bidding_strategies.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::BiddingStrategyService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_bidding_strategies.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BiddingStrategyService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_bidding_strategies` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_bidding_strategies + + # @private + def initialize parent_rpcs = nil + mutate_bidding_strategies_config = parent_rpcs.mutate_bidding_strategies if parent_rpcs.respond_to? :mutate_bidding_strategies + @mutate_bidding_strategies = ::Gapic::Config::Method.new mutate_bidding_strategies_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_strategy_service/credentials.rb b/lib/google/ads/google_ads/v16/services/bidding_strategy_service/credentials.rb new file mode 100644 index 000000000..9a596204e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_strategy_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingStrategyService + # Credentials for the BiddingStrategyService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_strategy_service/paths.rb b/lib/google/ads/google_ads/v16/services/bidding_strategy_service/paths.rb new file mode 100644 index 000000000..995b2e5bb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_strategy_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingStrategyService + # Path helper methods for the BiddingStrategyService API. + module Paths + ## + # Create a fully-qualified BiddingStrategy resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingStrategies/{bidding_strategy_id}` + # + # @param customer_id [String] + # @param bidding_strategy_id [String] + # + # @return [::String] + def bidding_strategy_path customer_id:, bidding_strategy_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingStrategies/#{bidding_strategy_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_strategy_service_pb.rb b/lib/google/ads/google_ads/v16/services/bidding_strategy_service_pb.rb new file mode 100644 index 000000000..d9dd869df --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_strategy_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/bidding_strategy_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/bidding_strategy_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n@google/ads/googleads/v16/services/bidding_strategy_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x39google/ads/googleads/v16/resources/bidding_strategy.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xac\x02\n\x1eMutateBiddingStrategiesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12T\n\noperations\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.BiddingStrategyOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xa7\x02\n\x18\x42iddingStrategyOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x45\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.BiddingStrategyH\x00\x12\x45\n\x06update\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.BiddingStrategyH\x00\x12?\n\x06remove\x18\x03 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/BiddingStrategyH\x00\x42\x0b\n\toperation\"\xa5\x01\n\x1fMutateBiddingStrategiesResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12O\n\x07results\x18\x02 \x03(\x0b\x32>.google.ads.googleads.v16.services.MutateBiddingStrategyResult\"\xb2\x01\n\x1bMutateBiddingStrategyResult\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/BiddingStrategy\x12M\n\x10\x62idding_strategy\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.BiddingStrategy2\xdf\x02\n\x16\x42iddingStrategyService\x12\xfd\x01\n\x17MutateBiddingStrategies\x12\x41.google.ads.googleads.v16.services.MutateBiddingStrategiesRequest\x1a\x42.google.ads.googleads.v16.services.MutateBiddingStrategiesResponse\"[\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02<\"7/v16/customers/{customer_id=*}/biddingStrategies:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x87\x02\n%com.google.ads.googleads.v16.servicesB\x1b\x42iddingStrategyServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.BiddingStrategy", "google/ads/googleads/v16/resources/bidding_strategy.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateBiddingStrategiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingStrategiesRequest").msgclass + BiddingStrategyOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.BiddingStrategyOperation").msgclass + MutateBiddingStrategiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingStrategiesResponse").msgclass + MutateBiddingStrategyResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBiddingStrategyResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/bidding_strategy_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/bidding_strategy_service_services_pb.rb new file mode 100644 index 000000000..9661b8319 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/bidding_strategy_service_services_pb.rb @@ -0,0 +1,78 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/bidding_strategy_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/bidding_strategy_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BiddingStrategyService + # Proto file describing the Bidding Strategy service. + # + # Service to manage bidding strategies. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.BiddingStrategyService' + + # Creates, updates, or removes bidding strategies. Operation statuses are + # returned. + # + # List of thrown errors: + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [BiddingStrategyError]() + # [ContextError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateBiddingStrategies, ::Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesRequest, ::Google::Ads::GoogleAds::V16::Services::MutateBiddingStrategiesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/billing_setup_service.rb b/lib/google/ads/google_ads/v16/services/billing_setup_service.rb new file mode 100644 index 000000000..af8e40d07 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/billing_setup_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/billing_setup_service/credentials" +require "google/ads/google_ads/v16/services/billing_setup_service/paths" +require "google/ads/google_ads/v16/services/billing_setup_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # A service for designating the business entity responsible for accrued costs. + # + # A billing setup is associated with a payments account. Billing-related + # activity for all billing setups associated with a particular payments account + # will appear on a single invoice generated monthly. + # + # Mutates: + # The REMOVE operation cancels a pending billing setup. + # The CREATE operation creates a new billing setup. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/billing_setup_service" + # client = ::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client.new + # + module BillingSetupService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "billing_setup_service", "helpers.rb" +require "google/ads/google_ads/v16/services/billing_setup_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/billing_setup_service/client.rb b/lib/google/ads/google_ads/v16/services/billing_setup_service/client.rb new file mode 100644 index 000000000..a6b025a93 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/billing_setup_service/client.rb @@ -0,0 +1,447 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/billing_setup_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BillingSetupService + ## + # Client for the BillingSetupService service. + # + # A service for designating the business entity responsible for accrued costs. + # + # A billing setup is associated with a payments account. Billing-related + # activity for all billing setups associated with a particular payments account + # will appear on a single invoice generated monthly. + # + # Mutates: + # The REMOVE operation cancels a pending billing setup. + # The CREATE operation creates a new billing setup. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :billing_setup_service_stub + + ## + # Configure the BillingSetupService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BillingSetupService clients + # ::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BillingSetupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @billing_setup_service_stub.universe_domain + end + + ## + # Create a new BillingSetupService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BillingSetupService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/billing_setup_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @billing_setup_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates a billing setup, or cancels an existing billing setup. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [BillingSetupError]() + # [DateError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_billing_setup(request, options = nil) + # Pass arguments to `mutate_billing_setup` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateBillingSetupRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateBillingSetupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_billing_setup(customer_id: nil, operation: nil) + # Pass arguments to `mutate_billing_setup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. Id of the customer to apply the billing setup mutate operation + # to. + # @param operation [::Google::Ads::GoogleAds::V16::Services::BillingSetupOperation, ::Hash] + # Required. The operation to perform. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateBillingSetupResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateBillingSetupResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateBillingSetupRequest.new + # + # # Call the mutate_billing_setup method. + # result = client.mutate_billing_setup request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateBillingSetupResponse. + # p result + # + def mutate_billing_setup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateBillingSetupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_billing_setup.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_billing_setup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_billing_setup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @billing_setup_service_stub.call_rpc :mutate_billing_setup, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the BillingSetupService API. + # + # This class represents the configuration for BillingSetupService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_billing_setup to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_billing_setup.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::BillingSetupService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_billing_setup.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BillingSetupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_billing_setup` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_billing_setup + + # @private + def initialize parent_rpcs = nil + mutate_billing_setup_config = parent_rpcs.mutate_billing_setup if parent_rpcs.respond_to? :mutate_billing_setup + @mutate_billing_setup = ::Gapic::Config::Method.new mutate_billing_setup_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/billing_setup_service/credentials.rb b/lib/google/ads/google_ads/v16/services/billing_setup_service/credentials.rb new file mode 100644 index 000000000..91f5d8fa6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/billing_setup_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BillingSetupService + # Credentials for the BillingSetupService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/billing_setup_service/paths.rb b/lib/google/ads/google_ads/v16/services/billing_setup_service/paths.rb new file mode 100644 index 000000000..544ed385a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/billing_setup_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BillingSetupService + # Path helper methods for the BillingSetupService API. + module Paths + ## + # Create a fully-qualified BillingSetup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/billingSetups/{billing_setup_id}` + # + # @param customer_id [String] + # @param billing_setup_id [String] + # + # @return [::String] + def billing_setup_path customer_id:, billing_setup_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/billingSetups/#{billing_setup_id}" + end + + ## + # Create a fully-qualified PaymentsAccount resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/paymentsAccounts/{payments_account_id}` + # + # @param customer_id [String] + # @param payments_account_id [String] + # + # @return [::String] + def payments_account_path customer_id:, payments_account_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/paymentsAccounts/#{payments_account_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/billing_setup_service_pb.rb b/lib/google/ads/google_ads/v16/services/billing_setup_service_pb.rb new file mode 100644 index 000000000..2042d4c76 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/billing_setup_service_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/billing_setup_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/billing_setup_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/services/billing_setup_service.proto\x12!google.ads.googleads.v16.services\x1a\x36google/ads/googleads/v16/resources/billing_setup.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x87\x01\n\x19MutateBillingSetupRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12P\n\toperation\x18\x02 \x01(\x0b\x32\x38.google.ads.googleads.v16.services.BillingSetupOperationB\x03\xe0\x41\x02\"\xa6\x01\n\x15\x42illingSetupOperation\x12\x42\n\x06\x63reate\x18\x02 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.BillingSetupH\x00\x12<\n\x06remove\x18\x01 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/BillingSetupH\x00\x42\x0b\n\toperation\"i\n\x1aMutateBillingSetupResponse\x12K\n\x06result\x18\x01 \x01(\x0b\x32;.google.ads.googleads.v16.services.MutateBillingSetupResult\"]\n\x18MutateBillingSetupResult\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/BillingSetup2\xc8\x02\n\x13\x42illingSetupService\x12\xe9\x01\n\x12MutateBillingSetup\x12<.google.ads.googleads.v16.services.MutateBillingSetupRequest\x1a=.google.ads.googleads.v16.services.MutateBillingSetupResponse\"V\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02\x38\"3/v16/customers/{customer_id=*}/billingSetups:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x84\x02\n%com.google.ads.googleads.v16.servicesB\x18\x42illingSetupServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.BillingSetup", "google/ads/googleads/v16/resources/billing_setup.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateBillingSetupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBillingSetupRequest").msgclass + BillingSetupOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.BillingSetupOperation").msgclass + MutateBillingSetupResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBillingSetupResponse").msgclass + MutateBillingSetupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateBillingSetupResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/billing_setup_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/billing_setup_service_services_pb.rb new file mode 100644 index 000000000..789b23399 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/billing_setup_service_services_pb.rb @@ -0,0 +1,69 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/billing_setup_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/billing_setup_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BillingSetupService + # Proto file describing the BillingSetup service. + # + # A service for designating the business entity responsible for accrued costs. + # + # A billing setup is associated with a payments account. Billing-related + # activity for all billing setups associated with a particular payments account + # will appear on a single invoice generated monthly. + # + # Mutates: + # The REMOVE operation cancels a pending billing setup. + # The CREATE operation creates a new billing setup. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.BillingSetupService' + + # Creates a billing setup, or cancels an existing billing setup. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [BillingSetupError]() + # [DateError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateBillingSetup, ::Google::Ads::GoogleAds::V16::Services::MutateBillingSetupRequest, ::Google::Ads::GoogleAds::V16::Services::MutateBillingSetupResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/brand_suggestion_service.rb b/lib/google/ads/google_ads/v16/services/brand_suggestion_service.rb new file mode 100644 index 000000000..70d64bfee --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/brand_suggestion_service.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/brand_suggestion_service/credentials" +require "google/ads/google_ads/v16/services/brand_suggestion_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # This service will suggest brands based on a prefix. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/brand_suggestion_service" + # client = ::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client.new + # + module BrandSuggestionService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "brand_suggestion_service", "helpers.rb" +require "google/ads/google_ads/v16/services/brand_suggestion_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/brand_suggestion_service/client.rb b/lib/google/ads/google_ads/v16/services/brand_suggestion_service/client.rb new file mode 100644 index 000000000..99918a0fd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/brand_suggestion_service/client.rb @@ -0,0 +1,429 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/brand_suggestion_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BrandSuggestionService + ## + # Client for the BrandSuggestionService service. + # + # This service will suggest brands based on a prefix. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :brand_suggestion_service_stub + + ## + # Configure the BrandSuggestionService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BrandSuggestionService clients + # ::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BrandSuggestionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @brand_suggestion_service_stub.universe_domain + end + + ## + # Create a new BrandSuggestionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BrandSuggestionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/brand_suggestion_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @brand_suggestion_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Rpc to return a list of matching brands based on a prefix for this + # customer. + # + # @overload suggest_brands(request, options = nil) + # Pass arguments to `suggest_brands` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SuggestBrandsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SuggestBrandsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_brands(customer_id: nil, brand_prefix: nil, selected_brands: nil) + # Pass arguments to `suggest_brands` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer onto which to apply the brand suggestion + # operation. + # @param brand_prefix [::String] + # Required. The prefix of a brand name. + # @param selected_brands [::Array<::String>] + # Optional. Ids of the brands already selected by advertisers. They will be + # excluded in response. These are expected to be brand ids not brand names. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::SuggestBrandsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::SuggestBrandsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SuggestBrandsRequest.new + # + # # Call the suggest_brands method. + # result = client.suggest_brands request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::SuggestBrandsResponse. + # p result + # + def suggest_brands request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SuggestBrandsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_brands.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.suggest_brands.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_brands.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @brand_suggestion_service_stub.call_rpc :suggest_brands, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the BrandSuggestionService API. + # + # This class represents the configuration for BrandSuggestionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # suggest_brands to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_brands.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::BrandSuggestionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_brands.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BrandSuggestionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `suggest_brands` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_brands + + # @private + def initialize parent_rpcs = nil + suggest_brands_config = parent_rpcs.suggest_brands if parent_rpcs.respond_to? :suggest_brands + @suggest_brands = ::Gapic::Config::Method.new suggest_brands_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/brand_suggestion_service/credentials.rb b/lib/google/ads/google_ads/v16/services/brand_suggestion_service/credentials.rb new file mode 100644 index 000000000..f6b12fa32 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/brand_suggestion_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BrandSuggestionService + # Credentials for the BrandSuggestionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/brand_suggestion_service_pb.rb b/lib/google/ads/google_ads/v16/services/brand_suggestion_service_pb.rb new file mode 100644 index 000000000..929421932 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/brand_suggestion_service_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/brand_suggestion_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/brand_state_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n@google/ads/googleads/v16/services/brand_suggestion_service.proto\x12!google.ads.googleads.v16.services\x1a\x30google/ads/googleads/v16/enums/brand_state.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"\x7f\n\x14SuggestBrandsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x0c\x62rand_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1c\n\x0fselected_brands\x18\x03 \x03(\tB\x03\xe0\x41\x01\x42\x0f\n\r_brand_prefix\"[\n\x15SuggestBrandsResponse\x12\x42\n\x06\x62rands\x18\x01 \x03(\x0b\x32\x32.google.ads.googleads.v16.services.BrandSuggestion\"\x83\x01\n\x0f\x42randSuggestion\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0c\n\x04urls\x18\x03 \x03(\t\x12H\n\x05state\x18\x04 \x01(\x0e\x32\x39.google.ads.googleads.v16.enums.BrandStateEnum.BrandState2\xb8\x02\n\x16\x42randSuggestionService\x12\xd6\x01\n\rSuggestBrands\x12\x37.google.ads.googleads.v16.services.SuggestBrandsRequest\x1a\x38.google.ads.googleads.v16.services.SuggestBrandsResponse\"R\xda\x41\x18\x63ustomer_id,brand_prefix\x82\xd3\xe4\x93\x02\x31\",/v16/customers/{customer_id=*}:suggestBrands:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x87\x02\n%com.google.ads.googleads.v16.servicesB\x1b\x42randSuggestionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + SuggestBrandsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestBrandsRequest").msgclass + SuggestBrandsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestBrandsResponse").msgclass + BrandSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.BrandSuggestion").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/brand_suggestion_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/brand_suggestion_service_services_pb.rb new file mode 100644 index 000000000..6679d476e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/brand_suggestion_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/brand_suggestion_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/brand_suggestion_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module BrandSuggestionService + # Proto file describing the MerchantCenterLink service. + # + # This service will suggest brands based on a prefix. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.BrandSuggestionService' + + # Rpc to return a list of matching brands based on a prefix for this + # customer. + rpc :SuggestBrands, ::Google::Ads::GoogleAds::V16::Services::SuggestBrandsRequest, ::Google::Ads::GoogleAds::V16::Services::SuggestBrandsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_service.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_service.rb new file mode 100644 index 000000000..5ed1416ce --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_asset_service/credentials" +require "google/ads/google_ads/v16/services/campaign_asset_service/paths" +require "google/ads/google_ads/v16/services/campaign_asset_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign assets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_asset_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client.new + # + module CampaignAssetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_asset_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_asset_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_service/client.rb new file mode 100644 index 000000000..eb902fe56 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_service/client.rb @@ -0,0 +1,452 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_asset_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignAssetService + ## + # Client for the CampaignAssetService service. + # + # Service to manage campaign assets. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_asset_service_stub + + ## + # Configure the CampaignAssetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignAssetService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignAssetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_asset_service_stub.universe_domain + end + + ## + # Create a new CampaignAssetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignAssetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_asset_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_asset_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes campaign assets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NotAllowlistedError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_campaign_assets(request, options = nil) + # Pass arguments to `mutate_campaign_assets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_assets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign assets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignAssetOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign assets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsRequest.new + # + # # Call the mutate_campaign_assets method. + # result = client.mutate_campaign_assets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsResponse. + # p result + # + def mutate_campaign_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_assets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_asset_service_stub.call_rpc :mutate_campaign_assets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignAssetService API. + # + # This class represents the configuration for CampaignAssetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_assets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_assets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignAssetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_assets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignAssetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_assets + + # @private + def initialize parent_rpcs = nil + mutate_campaign_assets_config = parent_rpcs.mutate_campaign_assets if parent_rpcs.respond_to? :mutate_campaign_assets + @mutate_campaign_assets = ::Gapic::Config::Method.new mutate_campaign_assets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_service/credentials.rb new file mode 100644 index 000000000..c5e0c5b02 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignAssetService + # Credentials for the CampaignAssetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_service/paths.rb new file mode 100644 index 000000000..721bb52f3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_service/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignAssetService + # Path helper methods for the CampaignAssetService API. + module Paths + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def campaign_asset_path customer_id:, campaign_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/campaignAssets/#{campaign_id}~#{asset_id}~#{field_type}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_service_pb.rb new file mode 100644 index 000000000..652c0dbd0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_asset_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_asset_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/campaign_asset_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x37google/ads/googleads/v16/resources/campaign_asset.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa7\x02\n\x1bMutateCampaignAssetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\noperations\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.CampaignAssetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x9f\x02\n\x16\x43\x61mpaignAssetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignAssetH\x00\x12\x43\n\x06update\x18\x03 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignAssetH\x00\x12=\n\x06remove\x18\x02 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CampaignAssetH\x00\x42\x0b\n\toperation\"\xa0\x01\n\x1cMutateCampaignAssetsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12M\n\x07results\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.MutateCampaignAssetResult\"\xaa\x01\n\x19MutateCampaignAssetResult\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CampaignAsset\x12I\n\x0e\x63\x61mpaign_asset\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignAsset2\xd1\x02\n\x14\x43\x61mpaignAssetService\x12\xf1\x01\n\x14MutateCampaignAssets\x12>.google.ads.googleads.v16.services.MutateCampaignAssetsRequest\x1a?.google.ads.googleads.v16.services.MutateCampaignAssetsResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/campaignAssets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x85\x02\n%com.google.ads.googleads.v16.servicesB\x19\x43\x61mpaignAssetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignAsset", "google/ads/googleads/v16/resources/campaign_asset.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignAssetsRequest").msgclass + CampaignAssetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignAssetOperation").msgclass + MutateCampaignAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignAssetsResponse").msgclass + MutateCampaignAssetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignAssetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_service_services_pb.rb new file mode 100644 index 000000000..8c129fefe --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_service_services_pb.rb @@ -0,0 +1,64 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_asset_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_asset_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignAssetService + # Proto file describing the CampaignAsset service. + # + # Service to manage campaign assets. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignAssetService' + + # Creates, updates, or removes campaign assets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NotAllowlistedError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCampaignAssets, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_set_service.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service.rb new file mode 100644 index 000000000..6f0a0ba04 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_asset_set_service/credentials" +require "google/ads/google_ads/v16/services/campaign_asset_set_service/paths" +require "google/ads/google_ads/v16/services/campaign_asset_set_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign asset set + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_asset_set_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client.new + # + module CampaignAssetSetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_asset_set_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_asset_set_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/client.rb new file mode 100644 index 000000000..800011d0f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_asset_set_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignAssetSetService + ## + # Client for the CampaignAssetSetService service. + # + # Service to manage campaign asset set + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_asset_set_service_stub + + ## + # Configure the CampaignAssetSetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignAssetSetService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignAssetSetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_asset_set_service_stub.universe_domain + end + + ## + # Create a new CampaignAssetSetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignAssetSetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_asset_set_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_asset_set_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes campaign asset sets. Operation statuses are + # returned. + # + # @overload mutate_campaign_asset_sets(request, options = nil) + # Pass arguments to `mutate_campaign_asset_sets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_asset_sets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_asset_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign asset sets are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign asset + # sets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsRequest.new + # + # # Call the mutate_campaign_asset_sets method. + # result = client.mutate_campaign_asset_sets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsResponse. + # p result + # + def mutate_campaign_asset_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_asset_sets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_asset_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_asset_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_asset_set_service_stub.call_rpc :mutate_campaign_asset_sets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignAssetSetService API. + # + # This class represents the configuration for CampaignAssetSetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_asset_sets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_asset_sets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignAssetSetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_asset_sets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignAssetSetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_asset_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_asset_sets + + # @private + def initialize parent_rpcs = nil + mutate_campaign_asset_sets_config = parent_rpcs.mutate_campaign_asset_sets if parent_rpcs.respond_to? :mutate_campaign_asset_sets + @mutate_campaign_asset_sets = ::Gapic::Config::Method.new mutate_campaign_asset_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/credentials.rb new file mode 100644 index 000000000..445e519a9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignAssetSetService + # Credentials for the CampaignAssetSetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/paths.rb new file mode 100644 index 000000000..13205d2b6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignAssetSetService + # Path helper methods for the CampaignAssetSetService API. + module Paths + ## + # Create a fully-qualified AssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSets/#{asset_set_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignAssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignAssetSets/{campaign_id}~{asset_set_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def campaign_asset_set_path customer_id:, campaign_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignAssetSets/#{campaign_id}~#{asset_set_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_set_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service_pb.rb new file mode 100644 index 000000000..8c9b7cc9e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_asset_set_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_asset_set_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/services/campaign_asset_set_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a;google/ads/googleads/v16/resources/campaign_asset_set.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xad\x02\n\x1eMutateCampaignAssetSetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12U\n\noperations\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.CampaignAssetSetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xb2\x01\n\x19\x43\x61mpaignAssetSetOperation\x12\x46\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CampaignAssetSetH\x00\x12@\n\x06remove\x18\x02 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/CampaignAssetSetH\x00\x42\x0b\n\toperation\"\xa6\x01\n\x1fMutateCampaignAssetSetsResponse\x12P\n\x07results\x18\x01 \x03(\x0b\x32?.google.ads.googleads.v16.services.MutateCampaignAssetSetResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xb7\x01\n\x1cMutateCampaignAssetSetResult\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/CampaignAssetSet\x12P\n\x12\x63\x61mpaign_asset_set\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CampaignAssetSet2\xe0\x02\n\x17\x43\x61mpaignAssetSetService\x12\xfd\x01\n\x17MutateCampaignAssetSets\x12\x41.google.ads.googleads.v16.services.MutateCampaignAssetSetsRequest\x1a\x42.google.ads.googleads.v16.services.MutateCampaignAssetSetsResponse\"[\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02<\"7/v16/customers/{customer_id=*}/campaignAssetSets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x88\x02\n%com.google.ads.googleads.v16.servicesB\x1c\x43\x61mpaignAssetSetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CampaignAssetSet", "google/ads/googleads/v16/resources/campaign_asset_set.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignAssetSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignAssetSetsRequest").msgclass + CampaignAssetSetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignAssetSetOperation").msgclass + MutateCampaignAssetSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignAssetSetsResponse").msgclass + MutateCampaignAssetSetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignAssetSetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_asset_set_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service_services_pb.rb new file mode 100644 index 000000000..9c0d643a2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_asset_set_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_asset_set_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_asset_set_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignAssetSetService + # Proto file describing the CampaignAssetSet service. + # + # Service to manage campaign asset set + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignAssetSetService' + + # Creates, updates or removes campaign asset sets. Operation statuses are + # returned. + rpc :MutateCampaignAssetSets, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignAssetSetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service.rb b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service.rb new file mode 100644 index 000000000..5274e74ce --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_bid_modifier_service/credentials" +require "google/ads/google_ads/v16/services/campaign_bid_modifier_service/paths" +require "google/ads/google_ads/v16/services/campaign_bid_modifier_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign bid modifiers. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_bid_modifier_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client.new + # + module CampaignBidModifierService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_bid_modifier_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_bid_modifier_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/client.rb new file mode 100644 index 000000000..6ab9aad45 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/client.rb @@ -0,0 +1,464 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_bid_modifier_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignBidModifierService + ## + # Client for the CampaignBidModifierService service. + # + # Service to manage campaign bid modifiers. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_bid_modifier_service_stub + + ## + # Configure the CampaignBidModifierService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignBidModifierService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignBidModifierService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_bid_modifier_service_stub.universe_domain + end + + ## + # Create a new CampaignBidModifierService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignBidModifierService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_bid_modifier_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_bid_modifier_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes campaign bid modifiers. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_campaign_bid_modifiers(request, options = nil) + # Pass arguments to `mutate_campaign_bid_modifiers` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_bid_modifiers(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_bid_modifiers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. ID of the customer whose campaign bid modifiers are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign bid + # modifiers. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersRequest.new + # + # # Call the mutate_campaign_bid_modifiers method. + # result = client.mutate_campaign_bid_modifiers request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersResponse. + # p result + # + def mutate_campaign_bid_modifiers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_bid_modifiers.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_bid_modifiers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_bid_modifiers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_bid_modifier_service_stub.call_rpc :mutate_campaign_bid_modifiers, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignBidModifierService API. + # + # This class represents the configuration for CampaignBidModifierService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_bid_modifiers to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_bid_modifiers.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignBidModifierService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_bid_modifiers.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignBidModifierService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_bid_modifiers` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_bid_modifiers + + # @private + def initialize parent_rpcs = nil + mutate_campaign_bid_modifiers_config = parent_rpcs.mutate_campaign_bid_modifiers if parent_rpcs.respond_to? :mutate_campaign_bid_modifiers + @mutate_campaign_bid_modifiers = ::Gapic::Config::Method.new mutate_campaign_bid_modifiers_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/credentials.rb new file mode 100644 index 000000000..12b28b5b8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignBidModifierService + # Credentials for the CampaignBidModifierService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/paths.rb new file mode 100644 index 000000000..d510871c3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignBidModifierService + # Path helper methods for the CampaignBidModifierService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignBidModifier resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBidModifiers/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def campaign_bid_modifier_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBidModifiers/#{campaign_id}~#{criterion_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service_pb.rb new file mode 100644 index 000000000..3892e6b8d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_bid_modifier_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_bid_modifier_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/services/campaign_bid_modifier_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a>google/ads/googleads/v16/resources/campaign_bid_modifier.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb3\x02\n!MutateCampaignBidModifiersRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12X\n\noperations\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.services.CampaignBidModifierOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xb7\x02\n\x1c\x43\x61mpaignBidModifierOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12I\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CampaignBidModifierH\x00\x12I\n\x06update\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CampaignBidModifierH\x00\x12\x43\n\x06remove\x18\x03 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/CampaignBidModifierH\x00\x42\x0b\n\toperation\"\xac\x01\n\"MutateCampaignBidModifiersResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12S\n\x07results\x18\x02 \x03(\x0b\x32\x42.google.ads.googleads.v16.services.MutateCampaignBidModifierResult\"\xc3\x01\n\x1fMutateCampaignBidModifierResult\x12H\n\rresource_name\x18\x01 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/CampaignBidModifier\x12V\n\x15\x63\x61mpaign_bid_modifier\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CampaignBidModifier2\xef\x02\n\x1a\x43\x61mpaignBidModifierService\x12\x89\x02\n\x1aMutateCampaignBidModifiers\x12\x44.google.ads.googleads.v16.services.MutateCampaignBidModifiersRequest\x1a\x45.google.ads.googleads.v16.services.MutateCampaignBidModifiersResponse\"^\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02?\":/v16/customers/{customer_id=*}/campaignBidModifiers:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8b\x02\n%com.google.ads.googleads.v16.servicesB\x1f\x43\x61mpaignBidModifierServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignBidModifier", "google/ads/googleads/v16/resources/campaign_bid_modifier.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignBidModifiersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignBidModifiersRequest").msgclass + CampaignBidModifierOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignBidModifierOperation").msgclass + MutateCampaignBidModifiersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignBidModifiersResponse").msgclass + MutateCampaignBidModifierResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignBidModifierResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service_services_pb.rb new file mode 100644 index 000000000..a80123daf --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_bid_modifier_service_services_pb.rb @@ -0,0 +1,74 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_bid_modifier_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_bid_modifier_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignBidModifierService + # Proto file describing the Campaign Bid Modifier service. + # + # Service to manage campaign bid modifiers. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignBidModifierService' + + # Creates, updates, or removes campaign bid modifiers. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ContextError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateCampaignBidModifiers, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignBidModifiersResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_budget_service.rb b/lib/google/ads/google_ads/v16/services/campaign_budget_service.rb new file mode 100644 index 000000000..4b77651a9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_budget_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_budget_service/credentials" +require "google/ads/google_ads/v16/services/campaign_budget_service/paths" +require "google/ads/google_ads/v16/services/campaign_budget_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign budgets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_budget_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client.new + # + module CampaignBudgetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_budget_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_budget_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_budget_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_budget_service/client.rb new file mode 100644 index 000000000..fe011a9fe --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_budget_service/client.rb @@ -0,0 +1,457 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_budget_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignBudgetService + ## + # Client for the CampaignBudgetService service. + # + # Service to manage campaign budgets. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_budget_service_stub + + ## + # Configure the CampaignBudgetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignBudgetService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignBudgetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_budget_service_stub.universe_domain + end + + ## + # Create a new CampaignBudgetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignBudgetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_budget_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_budget_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes campaign budgets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignBudgetError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [OperationAccessDeniedError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [StringLengthError]() + # + # @overload mutate_campaign_budgets(request, options = nil) + # Pass arguments to `mutate_campaign_budgets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_budgets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_budgets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign budgets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignBudgetOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign budgets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsRequest.new + # + # # Call the mutate_campaign_budgets method. + # result = client.mutate_campaign_budgets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsResponse. + # p result + # + def mutate_campaign_budgets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_budgets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_budgets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_budgets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_budget_service_stub.call_rpc :mutate_campaign_budgets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignBudgetService API. + # + # This class represents the configuration for CampaignBudgetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_budgets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_budgets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignBudgetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_budgets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignBudgetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_budgets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_budgets + + # @private + def initialize parent_rpcs = nil + mutate_campaign_budgets_config = parent_rpcs.mutate_campaign_budgets if parent_rpcs.respond_to? :mutate_campaign_budgets + @mutate_campaign_budgets = ::Gapic::Config::Method.new mutate_campaign_budgets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_budget_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_budget_service/credentials.rb new file mode 100644 index 000000000..80abf6862 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_budget_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignBudgetService + # Credentials for the CampaignBudgetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_budget_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_budget_service/paths.rb new file mode 100644 index 000000000..57509a9cb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_budget_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignBudgetService + # Path helper methods for the CampaignBudgetService API. + module Paths + ## + # Create a fully-qualified CampaignBudget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBudgets/{campaign_budget_id}` + # + # @param customer_id [String] + # @param campaign_budget_id [String] + # + # @return [::String] + def campaign_budget_path customer_id:, campaign_budget_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBudgets/#{campaign_budget_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_budget_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_budget_service_pb.rb new file mode 100644 index 000000000..973602d11 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_budget_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_budget_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_budget_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/services/campaign_budget_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x38google/ads/googleads/v16/resources/campaign_budget.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa9\x02\n\x1cMutateCampaignBudgetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12S\n\noperations\x18\x02 \x03(\x0b\x32:.google.ads.googleads.v16.services.CampaignBudgetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xa3\x02\n\x17\x43\x61mpaignBudgetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x44\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CampaignBudgetH\x00\x12\x44\n\x06update\x18\x02 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CampaignBudgetH\x00\x12>\n\x06remove\x18\x03 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/CampaignBudgetH\x00\x42\x0b\n\toperation\"\xa2\x01\n\x1dMutateCampaignBudgetsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12N\n\x07results\x18\x02 \x03(\x0b\x32=.google.ads.googleads.v16.services.MutateCampaignBudgetResult\"\xae\x01\n\x1aMutateCampaignBudgetResult\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/CampaignBudget\x12K\n\x0f\x63\x61mpaign_budget\x18\x02 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CampaignBudget2\xd6\x02\n\x15\x43\x61mpaignBudgetService\x12\xf5\x01\n\x15MutateCampaignBudgets\x12?.google.ads.googleads.v16.services.MutateCampaignBudgetsRequest\x1a@.google.ads.googleads.v16.services.MutateCampaignBudgetsResponse\"Y\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}/campaignBudgets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x86\x02\n%com.google.ads.googleads.v16.servicesB\x1a\x43\x61mpaignBudgetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignBudget", "google/ads/googleads/v16/resources/campaign_budget.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignBudgetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignBudgetsRequest").msgclass + CampaignBudgetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignBudgetOperation").msgclass + MutateCampaignBudgetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignBudgetsResponse").msgclass + MutateCampaignBudgetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignBudgetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_budget_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_budget_service_services_pb.rb new file mode 100644 index 000000000..ec468e37d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_budget_service_services_pb.rb @@ -0,0 +1,69 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_budget_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_budget_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignBudgetService + # Proto file describing the Campaign Budget service. + # + # Service to manage campaign budgets. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignBudgetService' + + # Creates, updates, or removes campaign budgets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignBudgetError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [OperationAccessDeniedError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [StringLengthError]() + rpc :MutateCampaignBudgets, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignBudgetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service.rb b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service.rb new file mode 100644 index 000000000..49bdedc82 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_conversion_goal_service/credentials" +require "google/ads/google_ads/v16/services/campaign_conversion_goal_service/paths" +require "google/ads/google_ads/v16/services/campaign_conversion_goal_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign conversion goal. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_conversion_goal_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client.new + # + module CampaignConversionGoalService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_conversion_goal_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_conversion_goal_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/client.rb new file mode 100644 index 000000000..e4268bd80 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/client.rb @@ -0,0 +1,432 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_conversion_goal_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignConversionGoalService + ## + # Client for the CampaignConversionGoalService service. + # + # Service to manage campaign conversion goal. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_conversion_goal_service_stub + + ## + # Configure the CampaignConversionGoalService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignConversionGoalService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignConversionGoalService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_conversion_goal_service_stub.universe_domain + end + + ## + # Create a new CampaignConversionGoalService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignConversionGoalService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_conversion_goal_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_conversion_goal_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes campaign conversion goals. Operation statuses + # are returned. + # + # @overload mutate_campaign_conversion_goals(request, options = nil) + # Pass arguments to `mutate_campaign_conversion_goals` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_conversion_goals(customer_id: nil, operations: nil, validate_only: nil) + # Pass arguments to `mutate_campaign_conversion_goals` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign conversion goals are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign + # conversion goal. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsRequest.new + # + # # Call the mutate_campaign_conversion_goals method. + # result = client.mutate_campaign_conversion_goals request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsResponse. + # p result + # + def mutate_campaign_conversion_goals request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_conversion_goals.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_conversion_goals.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_conversion_goals.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_conversion_goal_service_stub.call_rpc :mutate_campaign_conversion_goals, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignConversionGoalService API. + # + # This class represents the configuration for CampaignConversionGoalService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_conversion_goals to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_conversion_goals.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignConversionGoalService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_conversion_goals.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignConversionGoalService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_conversion_goals` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_conversion_goals + + # @private + def initialize parent_rpcs = nil + mutate_campaign_conversion_goals_config = parent_rpcs.mutate_campaign_conversion_goals if parent_rpcs.respond_to? :mutate_campaign_conversion_goals + @mutate_campaign_conversion_goals = ::Gapic::Config::Method.new mutate_campaign_conversion_goals_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/credentials.rb new file mode 100644 index 000000000..3c1052654 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignConversionGoalService + # Credentials for the CampaignConversionGoalService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/paths.rb new file mode 100644 index 000000000..99f1ddc68 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignConversionGoalService + # Path helper methods for the CampaignConversionGoalService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignConversionGoals/{campaign_id}~{category}~{source}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param category [String] + # @param source [String] + # + # @return [::String] + def campaign_conversion_goal_path customer_id:, campaign_id:, category:, source: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "category cannot contain /" if category.to_s.include? "/" + + "customers/#{customer_id}/campaignConversionGoals/#{campaign_id}~#{category}~#{source}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service_pb.rb new file mode 100644 index 000000000..0e75d24a3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_conversion_goal_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/campaign_conversion_goal_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nHgoogle/ads/googleads/v16/services/campaign_conversion_goal_service.proto\x12!google.ads.googleads.v16.services\x1a\x41google/ads/googleads/v16/resources/campaign_conversion_goal.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xb4\x01\n$MutateCampaignConversionGoalsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12[\n\noperations\x18\x02 \x03(\x0b\x32\x42.google.ads.googleads.v16.services.CampaignConversionGoalOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xad\x01\n\x1f\x43\x61mpaignConversionGoalOperation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12L\n\x06update\x18\x01 \x01(\x0b\x32:.google.ads.googleads.v16.resources.CampaignConversionGoalH\x00\x42\x0b\n\toperation\"\x7f\n%MutateCampaignConversionGoalsResponse\x12V\n\x07results\x18\x01 \x03(\x0b\x32\x45.google.ads.googleads.v16.services.MutateCampaignConversionGoalResult\"q\n\"MutateCampaignConversionGoalResult\x12K\n\rresource_name\x18\x01 \x01(\tB4\xfa\x41\x31\n/googleads.googleapis.com/CampaignConversionGoal2\xfe\x02\n\x1d\x43\x61mpaignConversionGoalService\x12\x95\x02\n\x1dMutateCampaignConversionGoals\x12G.google.ads.googleads.v16.services.MutateCampaignConversionGoalsRequest\x1aH.google.ads.googleads.v16.services.MutateCampaignConversionGoalsResponse\"a\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x42\"=/v16/customers/{customer_id=*}/campaignConversionGoals:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8e\x02\n%com.google.ads.googleads.v16.servicesB\"CampaignConversionGoalServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignConversionGoal", "google/ads/googleads/v16/resources/campaign_conversion_goal.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignConversionGoalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignConversionGoalsRequest").msgclass + CampaignConversionGoalOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignConversionGoalOperation").msgclass + MutateCampaignConversionGoalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignConversionGoalsResponse").msgclass + MutateCampaignConversionGoalResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignConversionGoalResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service_services_pb.rb new file mode 100644 index 000000000..80c59d3f2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_conversion_goal_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_conversion_goal_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_conversion_goal_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignConversionGoalService + # Proto file describing the CampaignConversionGoal service. + # + # Service to manage campaign conversion goal. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignConversionGoalService' + + # Creates, updates or removes campaign conversion goals. Operation statuses + # are returned. + rpc :MutateCampaignConversionGoals, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignConversionGoalsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_criterion_service.rb b/lib/google/ads/google_ads/v16/services/campaign_criterion_service.rb new file mode 100644 index 000000000..ce26d8ffa --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_criterion_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_criterion_service/credentials" +require "google/ads/google_ads/v16/services/campaign_criterion_service/paths" +require "google/ads/google_ads/v16/services/campaign_criterion_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign criteria. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_criterion_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client.new + # + module CampaignCriterionService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_criterion_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_criterion_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_criterion_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_criterion_service/client.rb new file mode 100644 index 000000000..7ae76a7b0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_criterion_service/client.rb @@ -0,0 +1,468 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_criterion_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignCriterionService + ## + # Client for the CampaignCriterionService service. + # + # Service to manage campaign criteria. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_criterion_service_stub + + ## + # Configure the CampaignCriterionService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignCriterionService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignCriterionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_criterion_service_stub.universe_domain + end + + ## + # Create a new CampaignCriterionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignCriterionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_criterion_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_criterion_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes criteria. Operation statuses are returned. + # + # List of thrown errors: + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignCriterionError]() + # [CollectionSizeError]() + # [ContextError]() + # [CriterionError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RegionCodeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_campaign_criteria(request, options = nil) + # Pass arguments to `mutate_campaign_criteria` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_criteria(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_criteria` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose criteria are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignCriterionOperation, ::Hash>] + # Required. The list of operations to perform on individual criteria. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaRequest.new + # + # # Call the mutate_campaign_criteria method. + # result = client.mutate_campaign_criteria request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaResponse. + # p result + # + def mutate_campaign_criteria request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_criteria.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_criteria.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_criteria.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_criterion_service_stub.call_rpc :mutate_campaign_criteria, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignCriterionService API. + # + # This class represents the configuration for CampaignCriterionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_criteria to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_criteria.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_criteria.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignCriterionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_criteria` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_criteria + + # @private + def initialize parent_rpcs = nil + mutate_campaign_criteria_config = parent_rpcs.mutate_campaign_criteria if parent_rpcs.respond_to? :mutate_campaign_criteria + @mutate_campaign_criteria = ::Gapic::Config::Method.new mutate_campaign_criteria_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_criterion_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_criterion_service/credentials.rb new file mode 100644 index 000000000..f9c779d67 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_criterion_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignCriterionService + # Credentials for the CampaignCriterionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_criterion_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_criterion_service/paths.rb new file mode 100644 index 000000000..78ec91b2d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_criterion_service/paths.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignCriterionService + # Path helper methods for the CampaignCriterionService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignCriteria/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def campaign_criterion_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignCriteria/#{campaign_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified CarrierConstant resource string. + # + # The resource will be in the following format: + # + # `carrierConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def carrier_constant_path criterion_id: + "carrierConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified CombinedAudience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/combinedAudiences/{combined_audience_id}` + # + # @param customer_id [String] + # @param combined_audience_id [String] + # + # @return [::String] + def combined_audience_path customer_id:, combined_audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/combinedAudiences/#{combined_audience_id}" + end + + ## + # Create a fully-qualified KeywordThemeConstant resource string. + # + # The resource will be in the following format: + # + # `keywordThemeConstants/{express_category_id}~{express_sub_category_id}` + # + # @param express_category_id [String] + # @param express_sub_category_id [String] + # + # @return [::String] + def keyword_theme_constant_path express_category_id:, express_sub_category_id: + raise ::ArgumentError, "express_category_id cannot contain /" if express_category_id.to_s.include? "/" + + "keywordThemeConstants/#{express_category_id}~#{express_sub_category_id}" + end + + ## + # Create a fully-qualified MobileAppCategoryConstant resource string. + # + # The resource will be in the following format: + # + # `mobileAppCategoryConstants/{mobile_app_category_id}` + # + # @param mobile_app_category_id [String] + # + # @return [::String] + def mobile_app_category_constant_path mobile_app_category_id: + "mobileAppCategoryConstants/#{mobile_app_category_id}" + end + + ## + # Create a fully-qualified MobileDeviceConstant resource string. + # + # The resource will be in the following format: + # + # `mobileDeviceConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def mobile_device_constant_path criterion_id: + "mobileDeviceConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified OperatingSystemVersionConstant resource string. + # + # The resource will be in the following format: + # + # `operatingSystemVersionConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def operating_system_version_constant_path criterion_id: + "operatingSystemVersionConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified TopicConstant resource string. + # + # The resource will be in the following format: + # + # `topicConstants/{topic_id}` + # + # @param topic_id [String] + # + # @return [::String] + def topic_constant_path topic_id: + "topicConstants/#{topic_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_criterion_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_criterion_service_pb.rb new file mode 100644 index 000000000..54b42ff86 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_criterion_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_criterion_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_criterion_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/services/campaign_criterion_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a;google/ads/googleads/v16/resources/campaign_criterion.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xad\x02\n\x1dMutateCampaignCriteriaRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12V\n\noperations\x18\x02 \x03(\x0b\x32=.google.ads.googleads.v16.services.CampaignCriterionOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xaf\x02\n\x1a\x43\x61mpaignCriterionOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12G\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.CampaignCriterionH\x00\x12G\n\x06update\x18\x02 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.CampaignCriterionH\x00\x12\x41\n\x06remove\x18\x03 \x01(\tB/\xfa\x41,\n*googleads.googleapis.com/CampaignCriterionH\x00\x42\x0b\n\toperation\"\xa6\x01\n\x1eMutateCampaignCriteriaResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12Q\n\x07results\x18\x02 \x03(\x0b\x32@.google.ads.googleads.v16.services.MutateCampaignCriterionResult\"\xba\x01\n\x1dMutateCampaignCriterionResult\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xfa\x41,\n*googleads.googleapis.com/CampaignCriterion\x12Q\n\x12\x63\x61mpaign_criterion\x18\x02 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.CampaignCriterion2\xdd\x02\n\x18\x43\x61mpaignCriterionService\x12\xf9\x01\n\x16MutateCampaignCriteria\x12@.google.ads.googleads.v16.services.MutateCampaignCriteriaRequest\x1a\x41.google.ads.googleads.v16.services.MutateCampaignCriteriaResponse\"Z\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02;\"6/v16/customers/{customer_id=*}/campaignCriteria:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x89\x02\n%com.google.ads.googleads.v16.servicesB\x1d\x43\x61mpaignCriterionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignCriterion", "google/ads/googleads/v16/resources/campaign_criterion.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignCriteriaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignCriteriaRequest").msgclass + CampaignCriterionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignCriterionOperation").msgclass + MutateCampaignCriteriaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignCriteriaResponse").msgclass + MutateCampaignCriterionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignCriterionResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_criterion_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_criterion_service_services_pb.rb new file mode 100644 index 000000000..28ec35cb8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_criterion_service_services_pb.rb @@ -0,0 +1,80 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_criterion_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_criterion_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignCriterionService + # Proto file describing the Campaign Criterion service. + # + # Service to manage campaign criteria. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignCriterionService' + + # Creates, updates, or removes criteria. Operation statuses are returned. + # + # List of thrown errors: + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignCriterionError]() + # [CollectionSizeError]() + # [ContextError]() + # [CriterionError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RegionCodeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateCampaignCriteria, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignCriteriaResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_customizer_service.rb b/lib/google/ads/google_ads/v16/services/campaign_customizer_service.rb new file mode 100644 index 000000000..40d3eb651 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_customizer_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_customizer_service/credentials" +require "google/ads/google_ads/v16/services/campaign_customizer_service/paths" +require "google/ads/google_ads/v16/services/campaign_customizer_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign customizer + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_customizer_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client.new + # + module CampaignCustomizerService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_customizer_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_customizer_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_customizer_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_customizer_service/client.rb new file mode 100644 index 000000000..a45eaca30 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_customizer_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_customizer_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignCustomizerService + ## + # Client for the CampaignCustomizerService service. + # + # Service to manage campaign customizer + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_customizer_service_stub + + ## + # Configure the CampaignCustomizerService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignCustomizerService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignCustomizerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_customizer_service_stub.universe_domain + end + + ## + # Create a new CampaignCustomizerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignCustomizerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_customizer_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_customizer_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes campaign customizers. Operation statuses are + # returned. + # + # @overload mutate_campaign_customizers(request, options = nil) + # Pass arguments to `mutate_campaign_customizers` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_customizers(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_customizers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign customizers are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign + # customizers. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersRequest.new + # + # # Call the mutate_campaign_customizers method. + # result = client.mutate_campaign_customizers request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersResponse. + # p result + # + def mutate_campaign_customizers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_customizers.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_customizers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_customizers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_customizer_service_stub.call_rpc :mutate_campaign_customizers, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignCustomizerService API. + # + # This class represents the configuration for CampaignCustomizerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_customizers to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_customizers.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignCustomizerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_customizers.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignCustomizerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_customizers` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_customizers + + # @private + def initialize parent_rpcs = nil + mutate_campaign_customizers_config = parent_rpcs.mutate_campaign_customizers if parent_rpcs.respond_to? :mutate_campaign_customizers + @mutate_campaign_customizers = ::Gapic::Config::Method.new mutate_campaign_customizers_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_customizer_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_customizer_service/credentials.rb new file mode 100644 index 000000000..5a696900c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_customizer_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignCustomizerService + # Credentials for the CampaignCustomizerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_customizer_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_customizer_service/paths.rb new file mode 100644 index 000000000..a25efce3e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_customizer_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignCustomizerService + # Path helper methods for the CampaignCustomizerService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignCustomizers/{campaign_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def campaign_customizer_path customer_id:, campaign_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignCustomizers/#{campaign_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified CustomizerAttribute resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customizerAttributes/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customizer_attribute_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customizerAttributes/#{customizer_attribute_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_customizer_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_customizer_service_pb.rb new file mode 100644 index 000000000..0652ab89b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_customizer_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_customizer_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_customizer_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/services/campaign_customizer_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a.google.ads.googleads.v16.services.CampaignCustomizerOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xb8\x01\n\x1b\x43\x61mpaignCustomizerOperation\x12H\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CampaignCustomizerH\x00\x12\x42\n\x06remove\x18\x02 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/CampaignCustomizerH\x00\x42\x0b\n\toperation\"\xaa\x01\n!MutateCampaignCustomizersResponse\x12R\n\x07results\x18\x01 \x03(\x0b\x32\x41.google.ads.googleads.v16.services.MutateCampaignCustomizerResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xbe\x01\n\x1eMutateCampaignCustomizerResult\x12G\n\rresource_name\x18\x01 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/CampaignCustomizer\x12S\n\x13\x63\x61mpaign_customizer\x18\x02 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CampaignCustomizer2\xea\x02\n\x19\x43\x61mpaignCustomizerService\x12\x85\x02\n\x19MutateCampaignCustomizers\x12\x43.google.ads.googleads.v16.services.MutateCampaignCustomizersRequest\x1a\x44.google.ads.googleads.v16.services.MutateCampaignCustomizersResponse\"]\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02>\"9/v16/customers/{customer_id=*}/campaignCustomizers:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8a\x02\n%com.google.ads.googleads.v16.servicesB\x1e\x43\x61mpaignCustomizerServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CampaignCustomizer", "google/ads/googleads/v16/resources/campaign_customizer.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignCustomizersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignCustomizersRequest").msgclass + CampaignCustomizerOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignCustomizerOperation").msgclass + MutateCampaignCustomizersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignCustomizersResponse").msgclass + MutateCampaignCustomizerResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignCustomizerResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_customizer_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_customizer_service_services_pb.rb new file mode 100644 index 000000000..acceb3656 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_customizer_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_customizer_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_customizer_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignCustomizerService + # Proto file describing the CampaignCustomizer service. + # + # Service to manage campaign customizer + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignCustomizerService' + + # Creates, updates or removes campaign customizers. Operation statuses are + # returned. + rpc :MutateCampaignCustomizers, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignCustomizersResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_draft_service.rb b/lib/google/ads/google_ads/v16/services/campaign_draft_service.rb new file mode 100644 index 000000000..fa9ff80c7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_draft_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_draft_service/credentials" +require "google/ads/google_ads/v16/services/campaign_draft_service/paths" +require "google/ads/google_ads/v16/services/campaign_draft_service/operations" +require "google/ads/google_ads/v16/services/campaign_draft_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign drafts. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_draft_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.new + # + module CampaignDraftService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_draft_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_draft_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_draft_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_draft_service/client.rb new file mode 100644 index 000000000..c6ba49af5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_draft_service/client.rb @@ -0,0 +1,706 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_draft_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignDraftService + ## + # Client for the CampaignDraftService service. + # + # Service to manage campaign drafts. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_draft_service_stub + + ## + # Configure the CampaignDraftService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignDraftService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignDraftService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_draft_service_stub.universe_domain + end + + ## + # Create a new CampaignDraftService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignDraftService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_draft_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @campaign_draft_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Operations] + # + attr_reader :operations_client + + # Service calls + + ## + # Creates, updates, or removes campaign drafts. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignDraftError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_campaign_drafts(request, options = nil) + # Pass arguments to `mutate_campaign_drafts` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_drafts(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_drafts` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign drafts are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignDraftOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign drafts. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsRequest.new + # + # # Call the mutate_campaign_drafts method. + # result = client.mutate_campaign_drafts request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsResponse. + # p result + # + def mutate_campaign_drafts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_drafts.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_drafts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_drafts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_draft_service_stub.call_rpc :mutate_campaign_drafts, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Promotes the changes in a draft back to the base campaign. + # + # This method returns a Long Running Operation (LRO) indicating if the + # Promote is done. Use [Operations.GetOperation] to poll the LRO until it + # is done. Only a done status is returned in the response. See the status + # in the Campaign Draft resource to determine if the promotion was + # successful. If the LRO failed, use + # {::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client#list_campaign_draft_async_errors CampaignDraftService.ListCampaignDraftAsyncErrors} + # to view the list of error reasons. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignDraftError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload promote_campaign_draft(request, options = nil) + # Pass arguments to `promote_campaign_draft` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::PromoteCampaignDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::PromoteCampaignDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload promote_campaign_draft(campaign_draft: nil, validate_only: nil) + # Pass arguments to `promote_campaign_draft` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param campaign_draft [::String] + # Required. The resource name of the campaign draft to promote. + # @param validate_only [::Boolean] + # If true, the request is validated but no Long Running Operation is created. + # Only errors are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::PromoteCampaignDraftRequest.new + # + # # Call the promote_campaign_draft method. + # result = client.promote_campaign_draft request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def promote_campaign_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::PromoteCampaignDraftRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.promote_campaign_draft.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.campaign_draft + header_params["campaign_draft"] = request.campaign_draft + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.promote_campaign_draft.timeout, + metadata: metadata, + retry_policy: @config.rpcs.promote_campaign_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_draft_service_stub.call_rpc :promote_campaign_draft, request, + options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns all errors that occurred during CampaignDraft promote. Throws an + # error if called before campaign draft is promoted. + # Supports standard list paging. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload list_campaign_draft_async_errors(request, options = nil) + # Pass arguments to `list_campaign_draft_async_errors` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListCampaignDraftAsyncErrorsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListCampaignDraftAsyncErrorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_campaign_draft_async_errors(resource_name: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_campaign_draft_async_errors` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The name of the campaign draft from which to retrieve the async + # errors. + # @param page_token [::String] + # Token of the page to retrieve. If not specified, the first + # page of results will be returned. Use the value obtained from + # `next_page_token` in the previous response in order to request + # the next page of results. + # @param page_size [::Integer] + # Number of elements to retrieve in a single page. + # When a page request is too large, the server may decide to + # further limit the number of returned resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Rpc::Status>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Rpc::Status>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListCampaignDraftAsyncErrorsRequest.new + # + # # Call the list_campaign_draft_async_errors method. + # result = client.list_campaign_draft_async_errors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Rpc::Status. + # p item + # end + # + def list_campaign_draft_async_errors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListCampaignDraftAsyncErrorsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_campaign_draft_async_errors.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_campaign_draft_async_errors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_campaign_draft_async_errors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_draft_service_stub.call_rpc :list_campaign_draft_async_errors, request, + options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @campaign_draft_service_stub, + :list_campaign_draft_async_errors, request, response, operation, options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignDraftService API. + # + # This class represents the configuration for CampaignDraftService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_drafts to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_drafts.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignDraftService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_drafts.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignDraftService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_drafts` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_drafts + ## + # RPC-specific configuration for `promote_campaign_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :promote_campaign_draft + ## + # RPC-specific configuration for `list_campaign_draft_async_errors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_campaign_draft_async_errors + + # @private + def initialize parent_rpcs = nil + mutate_campaign_drafts_config = parent_rpcs.mutate_campaign_drafts if parent_rpcs.respond_to? :mutate_campaign_drafts + @mutate_campaign_drafts = ::Gapic::Config::Method.new mutate_campaign_drafts_config + promote_campaign_draft_config = parent_rpcs.promote_campaign_draft if parent_rpcs.respond_to? :promote_campaign_draft + @promote_campaign_draft = ::Gapic::Config::Method.new promote_campaign_draft_config + list_campaign_draft_async_errors_config = parent_rpcs.list_campaign_draft_async_errors if parent_rpcs.respond_to? :list_campaign_draft_async_errors + @list_campaign_draft_async_errors = ::Gapic::Config::Method.new list_campaign_draft_async_errors_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_draft_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_draft_service/credentials.rb new file mode 100644 index 000000000..50152c2a9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_draft_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignDraftService + # Credentials for the CampaignDraftService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_draft_service/operations.rb b/lib/google/ads/google_ads/v16/services/campaign_draft_service/operations.rb new file mode 100644 index 000000000..b5caf893e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_draft_service/operations.rb @@ -0,0 +1,813 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignDraftService + # Service that implements Longrunning Operations API. + class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CampaignDraftService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignDraftService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, + operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_draft_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_draft_service/paths.rb new file mode 100644 index 000000000..e2f74d978 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_draft_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignDraftService + # Path helper methods for the CampaignDraftService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignDraft resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignDrafts/{base_campaign_id}~{draft_id}` + # + # @param customer_id [String] + # @param base_campaign_id [String] + # @param draft_id [String] + # + # @return [::String] + def campaign_draft_path customer_id:, base_campaign_id:, draft_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "base_campaign_id cannot contain /" if base_campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignDrafts/#{base_campaign_id}~#{draft_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_draft_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_draft_service_pb.rb new file mode 100644 index 000000000..16ae4e547 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_draft_service_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_draft_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_draft_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/campaign_draft_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x37google/ads/googleads/v16/resources/campaign_draft.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa7\x02\n\x1bMutateCampaignDraftsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\noperations\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.CampaignDraftOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"|\n\x1bPromoteCampaignDraftRequest\x12\x46\n\x0e\x63\x61mpaign_draft\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&googleads.googleapis.com/CampaignDraft\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\"\x9f\x02\n\x16\x43\x61mpaignDraftOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignDraftH\x00\x12\x43\n\x06update\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignDraftH\x00\x12=\n\x06remove\x18\x03 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CampaignDraftH\x00\x42\x0b\n\toperation\"\xa0\x01\n\x1cMutateCampaignDraftsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12M\n\x07results\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.MutateCampaignDraftResult\"\xaa\x01\n\x19MutateCampaignDraftResult\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CampaignDraft\x12I\n\x0e\x63\x61mpaign_draft\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignDraft\"\x93\x01\n#ListCampaignDraftAsyncErrorsRequest\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&googleads.googleapis.com/CampaignDraft\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"c\n$ListCampaignDraftAsyncErrorsResponse\x12\"\n\x06\x65rrors\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xe0\x06\n\x14\x43\x61mpaignDraftService\x12\xf1\x01\n\x14MutateCampaignDrafts\x12>.google.ads.googleads.v16.services.MutateCampaignDraftsRequest\x1a?.google.ads.googleads.v16.services.MutateCampaignDraftsResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/campaignDrafts:mutate:\x01*\x12\xff\x01\n\x14PromoteCampaignDraft\x12>.google.ads.googleads.v16.services.PromoteCampaignDraftRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41.\n\x15google.protobuf.Empty\x12\x15google.protobuf.Empty\xda\x41\x0e\x63\x61mpaign_draft\x82\xd3\xe4\x93\x02?\":/v16/{campaign_draft=customers/*/campaignDrafts/*}:promote:\x01*\x12\x8a\x02\n\x1cListCampaignDraftAsyncErrors\x12\x46.google.ads.googleads.v16.services.ListCampaignDraftAsyncErrorsRequest\x1aG.google.ads.googleads.v16.services.ListCampaignDraftAsyncErrorsResponse\"Y\xda\x41\rresource_name\x82\xd3\xe4\x93\x02\x43\x12\x41/v16/{resource_name=customers/*/campaignDrafts/*}:listAsyncErrors\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x85\x02\n%com.google.ads.googleads.v16.servicesB\x19\x43\x61mpaignDraftServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignDraft", "google/ads/googleads/v16/resources/campaign_draft.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignDraftsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignDraftsRequest").msgclass + PromoteCampaignDraftRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.PromoteCampaignDraftRequest").msgclass + CampaignDraftOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignDraftOperation").msgclass + MutateCampaignDraftsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignDraftsResponse").msgclass + MutateCampaignDraftResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignDraftResult").msgclass + ListCampaignDraftAsyncErrorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListCampaignDraftAsyncErrorsRequest").msgclass + ListCampaignDraftAsyncErrorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListCampaignDraftAsyncErrorsResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_draft_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_draft_service_services_pb.rb new file mode 100644 index 000000000..f252844b0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_draft_service_services_pb.rb @@ -0,0 +1,93 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_draft_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_draft_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignDraftService + # Proto file describing the Campaign Draft service. + # + # Service to manage campaign drafts. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignDraftService' + + # Creates, updates, or removes campaign drafts. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignDraftError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCampaignDrafts, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignDraftsResponse + # Promotes the changes in a draft back to the base campaign. + # + # This method returns a Long Running Operation (LRO) indicating if the + # Promote is done. Use [Operations.GetOperation] to poll the LRO until it + # is done. Only a done status is returned in the response. See the status + # in the Campaign Draft resource to determine if the promotion was + # successful. If the LRO failed, use + # [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v16.services.CampaignDraftService.ListCampaignDraftAsyncErrors] + # to view the list of error reasons. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignDraftError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :PromoteCampaignDraft, ::Google::Ads::GoogleAds::V16::Services::PromoteCampaignDraftRequest, ::Google::Longrunning::Operation + # Returns all errors that occurred during CampaignDraft promote. Throws an + # error if called before campaign draft is promoted. + # Supports standard list paging. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :ListCampaignDraftAsyncErrors, ::Google::Ads::GoogleAds::V16::Services::ListCampaignDraftAsyncErrorsRequest, ::Google::Ads::GoogleAds::V16::Services::ListCampaignDraftAsyncErrorsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service.rb b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service.rb new file mode 100644 index 000000000..e22667079 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_extension_setting_service/credentials" +require "google/ads/google_ads/v16/services/campaign_extension_setting_service/paths" +require "google/ads/google_ads/v16/services/campaign_extension_setting_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign extension settings. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_extension_setting_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client.new + # + module CampaignExtensionSettingService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_extension_setting_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_extension_setting_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/client.rb new file mode 100644 index 000000000..1c1fa27e4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/client.rb @@ -0,0 +1,469 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_extension_setting_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignExtensionSettingService + ## + # Client for the CampaignExtensionSettingService service. + # + # Service to manage campaign extension settings. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_extension_setting_service_stub + + ## + # Configure the CampaignExtensionSettingService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignExtensionSettingService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignExtensionSettingService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_extension_setting_service_stub.universe_domain + end + + ## + # Create a new CampaignExtensionSettingService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignExtensionSettingService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_extension_setting_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_extension_setting_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes campaign extension settings. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [ExtensionSettingError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # + # @overload mutate_campaign_extension_settings(request, options = nil) + # Pass arguments to `mutate_campaign_extension_settings` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_extension_settings(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_extension_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign extension settings are + # being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign + # extension settings. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsRequest.new + # + # # Call the mutate_campaign_extension_settings method. + # result = client.mutate_campaign_extension_settings request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsResponse. + # p result + # + def mutate_campaign_extension_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_extension_settings.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_extension_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_extension_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_extension_setting_service_stub.call_rpc :mutate_campaign_extension_settings, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignExtensionSettingService API. + # + # This class represents the configuration for CampaignExtensionSettingService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_extension_settings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_extension_settings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignExtensionSettingService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_extension_settings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignExtensionSettingService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_extension_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_extension_settings + + # @private + def initialize parent_rpcs = nil + mutate_campaign_extension_settings_config = parent_rpcs.mutate_campaign_extension_settings if parent_rpcs.respond_to? :mutate_campaign_extension_settings + @mutate_campaign_extension_settings = ::Gapic::Config::Method.new mutate_campaign_extension_settings_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/credentials.rb new file mode 100644 index 000000000..9ac7be8d4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignExtensionSettingService + # Credentials for the CampaignExtensionSettingService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/paths.rb new file mode 100644 index 000000000..377bee5fa --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignExtensionSettingService + # Path helper methods for the CampaignExtensionSettingService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignExtensionSettings/{campaign_id}~{extension_type}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param extension_type [String] + # + # @return [::String] + def campaign_extension_setting_path customer_id:, campaign_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignExtensionSettings/#{campaign_id}~#{extension_type}" + end + + ## + # Create a fully-qualified ExtensionFeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/extensionFeedItems/{feed_item_id}` + # + # @param customer_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def extension_feed_item_path customer_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/extensionFeedItems/#{feed_item_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service_pb.rb new file mode 100644 index 000000000..2e16eb9d5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_extension_setting_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_extension_setting_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nJgoogle/ads/googleads/v16/services/campaign_extension_setting_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x43google/ads/googleads/v16/resources/campaign_extension_setting.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xbd\x02\n&MutateCampaignExtensionSettingsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12]\n\noperations\x18\x02 \x03(\x0b\x32\x44.google.ads.googleads.v16.services.CampaignExtensionSettingOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xcb\x02\n!CampaignExtensionSettingOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12N\n\x06\x63reate\x18\x01 \x01(\x0b\x32<.google.ads.googleads.v16.resources.CampaignExtensionSettingH\x00\x12N\n\x06update\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.resources.CampaignExtensionSettingH\x00\x12H\n\x06remove\x18\x03 \x01(\tB6\xfa\x41\x33\n1googleads.googleapis.com/CampaignExtensionSettingH\x00\x42\x0b\n\toperation\"\xb6\x01\n\'MutateCampaignExtensionSettingsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12X\n\x07results\x18\x02 \x03(\x0b\x32G.google.ads.googleads.v16.services.MutateCampaignExtensionSettingResult\"\xd7\x01\n$MutateCampaignExtensionSettingResult\x12M\n\rresource_name\x18\x01 \x01(\tB6\xfa\x41\x33\n1googleads.googleapis.com/CampaignExtensionSetting\x12`\n\x1a\x63\x61mpaign_extension_setting\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.resources.CampaignExtensionSetting2\x88\x03\n\x1f\x43\x61mpaignExtensionSettingService\x12\x9d\x02\n\x1fMutateCampaignExtensionSettings\x12I.google.ads.googleads.v16.services.MutateCampaignExtensionSettingsRequest\x1aJ.google.ads.googleads.v16.services.MutateCampaignExtensionSettingsResponse\"c\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x44\"?/v16/customers/{customer_id=*}/campaignExtensionSettings:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x90\x02\n%com.google.ads.googleads.v16.servicesB$CampaignExtensionSettingServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignExtensionSetting", "google/ads/googleads/v16/resources/campaign_extension_setting.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignExtensionSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignExtensionSettingsRequest").msgclass + CampaignExtensionSettingOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignExtensionSettingOperation").msgclass + MutateCampaignExtensionSettingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignExtensionSettingsResponse").msgclass + MutateCampaignExtensionSettingResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignExtensionSettingResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service_services_pb.rb new file mode 100644 index 000000000..c1058a5f8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_extension_setting_service_services_pb.rb @@ -0,0 +1,79 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_extension_setting_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_extension_setting_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignExtensionSettingService + # Proto file describing the CampaignExtensionSetting service. + # + # Service to manage campaign extension settings. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignExtensionSettingService' + + # Creates, updates, or removes campaign extension settings. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [ExtensionSettingError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateCampaignExtensionSettings, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignExtensionSettingsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_feed_service.rb b/lib/google/ads/google_ads/v16/services/campaign_feed_service.rb new file mode 100644 index 000000000..5da00456b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_feed_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_feed_service/credentials" +require "google/ads/google_ads/v16/services/campaign_feed_service/paths" +require "google/ads/google_ads/v16/services/campaign_feed_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign feeds. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_feed_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client.new + # + module CampaignFeedService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_feed_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_feed_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_feed_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_feed_service/client.rb new file mode 100644 index 000000000..1bfa76471 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_feed_service/client.rb @@ -0,0 +1,463 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_feed_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignFeedService + ## + # Client for the CampaignFeedService service. + # + # Service to manage campaign feeds. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_feed_service_stub + + ## + # Configure the CampaignFeedService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignFeedService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignFeedService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_feed_service_stub.universe_domain + end + + ## + # Create a new CampaignFeedService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignFeedService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_feed_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_feed_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes campaign feeds. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignFeedError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_campaign_feeds(request, options = nil) + # Pass arguments to `mutate_campaign_feeds` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_feeds(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_feeds` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign feeds are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignFeedOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign feeds. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsRequest.new + # + # # Call the mutate_campaign_feeds method. + # result = client.mutate_campaign_feeds request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsResponse. + # p result + # + def mutate_campaign_feeds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_feeds.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_feeds.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_feeds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_feed_service_stub.call_rpc :mutate_campaign_feeds, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignFeedService API. + # + # This class represents the configuration for CampaignFeedService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_feeds to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_feeds.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignFeedService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_feeds.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignFeedService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_feeds` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_feeds + + # @private + def initialize parent_rpcs = nil + mutate_campaign_feeds_config = parent_rpcs.mutate_campaign_feeds if parent_rpcs.respond_to? :mutate_campaign_feeds + @mutate_campaign_feeds = ::Gapic::Config::Method.new mutate_campaign_feeds_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_feed_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_feed_service/credentials.rb new file mode 100644 index 000000000..c51ad04ef --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_feed_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignFeedService + # Credentials for the CampaignFeedService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_feed_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_feed_service/paths.rb new file mode 100644 index 000000000..4cbb5dbeb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_feed_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignFeedService + # Path helper methods for the CampaignFeedService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignFeeds/{campaign_id}~{feed_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param feed_id [String] + # + # @return [::String] + def campaign_feed_path customer_id:, campaign_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignFeeds/#{campaign_id}~#{feed_id}" + end + + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_feed_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_feed_service_pb.rb new file mode 100644 index 000000000..3b32feeb6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_feed_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_feed_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_feed_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/services/campaign_feed_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x36google/ads/googleads/v16/resources/campaign_feed.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa5\x02\n\x1aMutateCampaignFeedsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Q\n\noperations\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.CampaignFeedOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x9b\x02\n\x15\x43\x61mpaignFeedOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x42\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CampaignFeedH\x00\x12\x42\n\x06update\x18\x02 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CampaignFeedH\x00\x12<\n\x06remove\x18\x03 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/CampaignFeedH\x00\x42\x0b\n\toperation\"\x9e\x01\n\x1bMutateCampaignFeedsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12L\n\x07results\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.MutateCampaignFeedResult\"\xa6\x01\n\x18MutateCampaignFeedResult\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/CampaignFeed\x12G\n\rcampaign_feed\x18\x02 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CampaignFeed2\xcc\x02\n\x13\x43\x61mpaignFeedService\x12\xed\x01\n\x13MutateCampaignFeeds\x12=.google.ads.googleads.v16.services.MutateCampaignFeedsRequest\x1a>.google.ads.googleads.v16.services.MutateCampaignFeedsResponse\"W\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x38\"3/v16/customers/{customer_id=*}/campaignFeeds:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x84\x02\n%com.google.ads.googleads.v16.servicesB\x18\x43\x61mpaignFeedServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignFeed", "google/ads/googleads/v16/resources/campaign_feed.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignFeedsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignFeedsRequest").msgclass + CampaignFeedOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignFeedOperation").msgclass + MutateCampaignFeedsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignFeedsResponse").msgclass + MutateCampaignFeedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignFeedResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_feed_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_feed_service_services_pb.rb new file mode 100644 index 000000000..b1d5285db --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_feed_service_services_pb.rb @@ -0,0 +1,75 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_feed_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_feed_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignFeedService + # Proto file describing the CampaignFeed service. + # + # Service to manage campaign feeds. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignFeedService' + + # Creates, updates, or removes campaign feeds. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignFeedError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateCampaignFeeds, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignFeedsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_group_service.rb b/lib/google/ads/google_ads/v16/services/campaign_group_service.rb new file mode 100644 index 000000000..8e06ad6e6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_group_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_group_service/credentials" +require "google/ads/google_ads/v16/services/campaign_group_service/paths" +require "google/ads/google_ads/v16/services/campaign_group_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign groups. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_group_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client.new + # + module CampaignGroupService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_group_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_group_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_group_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_group_service/client.rb new file mode 100644 index 000000000..fed250e00 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_group_service/client.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_group_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignGroupService + ## + # Client for the CampaignGroupService service. + # + # Service to manage campaign groups. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_group_service_stub + + ## + # Configure the CampaignGroupService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignGroupService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignGroupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_group_service_stub.universe_domain + end + + ## + # Create a new CampaignGroupService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignGroupService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_group_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_group_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes campaign groups. Operation statuses are + # returned. + # + # @overload mutate_campaign_groups(request, options = nil) + # Pass arguments to `mutate_campaign_groups` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_groups(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign groups are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignGroupOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign groups. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsRequest.new + # + # # Call the mutate_campaign_groups method. + # result = client.mutate_campaign_groups request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsResponse. + # p result + # + def mutate_campaign_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_groups.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_group_service_stub.call_rpc :mutate_campaign_groups, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignGroupService API. + # + # This class represents the configuration for CampaignGroupService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_groups to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_groups.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignGroupService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_groups.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignGroupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_groups + + # @private + def initialize parent_rpcs = nil + mutate_campaign_groups_config = parent_rpcs.mutate_campaign_groups if parent_rpcs.respond_to? :mutate_campaign_groups + @mutate_campaign_groups = ::Gapic::Config::Method.new mutate_campaign_groups_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_group_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_group_service/credentials.rb new file mode 100644 index 000000000..83ea60df8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_group_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignGroupService + # Credentials for the CampaignGroupService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_group_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_group_service/paths.rb new file mode 100644 index 000000000..50ce5f0d8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_group_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignGroupService + # Path helper methods for the CampaignGroupService API. + module Paths + ## + # Create a fully-qualified CampaignGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignGroups/{campaign_group_id}` + # + # @param customer_id [String] + # @param campaign_group_id [String] + # + # @return [::String] + def campaign_group_path customer_id:, campaign_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignGroups/#{campaign_group_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_group_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_group_service_pb.rb new file mode 100644 index 000000000..40f2aca7e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_group_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_group_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_group_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/campaign_group_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x37google/ads/googleads/v16/resources/campaign_group.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa7\x02\n\x1bMutateCampaignGroupsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\noperations\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.CampaignGroupOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x9f\x02\n\x16\x43\x61mpaignGroupOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignGroupH\x00\x12\x43\n\x06update\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignGroupH\x00\x12=\n\x06remove\x18\x03 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CampaignGroupH\x00\x42\x0b\n\toperation\"\xa0\x01\n\x1cMutateCampaignGroupsResponse\x12M\n\x07results\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.MutateCampaignGroupResult\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\xad\x01\n\x19MutateCampaignGroupResult\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&googleads.googleapis.com/CampaignGroup\x12I\n\x0e\x63\x61mpaign_group\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignGroup2\xd1\x02\n\x14\x43\x61mpaignGroupService\x12\xf1\x01\n\x14MutateCampaignGroups\x12>.google.ads.googleads.v16.services.MutateCampaignGroupsRequest\x1a?.google.ads.googleads.v16.services.MutateCampaignGroupsResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/campaignGroups:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x85\x02\n%com.google.ads.googleads.v16.servicesB\x19\x43\x61mpaignGroupServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignGroup", "google/ads/googleads/v16/resources/campaign_group.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignGroupsRequest").msgclass + CampaignGroupOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignGroupOperation").msgclass + MutateCampaignGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignGroupsResponse").msgclass + MutateCampaignGroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignGroupResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_group_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_group_service_services_pb.rb new file mode 100644 index 000000000..c6f556fa6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_group_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_group_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_group_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignGroupService + # Proto file describing the Campaign group service. + # + # Service to manage campaign groups. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignGroupService' + + # Creates, updates, or removes campaign groups. Operation statuses are + # returned. + rpc :MutateCampaignGroups, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignGroupsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_label_service.rb b/lib/google/ads/google_ads/v16/services/campaign_label_service.rb new file mode 100644 index 000000000..871b31f0d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_label_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_label_service/credentials" +require "google/ads/google_ads/v16/services/campaign_label_service/paths" +require "google/ads/google_ads/v16/services/campaign_label_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage labels on campaigns. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_label_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client.new + # + module CampaignLabelService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_label_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_label_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_label_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_label_service/client.rb new file mode 100644 index 000000000..d1e4d5b55 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_label_service/client.rb @@ -0,0 +1,450 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_label_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignLabelService + ## + # Client for the CampaignLabelService service. + # + # Service to manage labels on campaigns. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_label_service_stub + + ## + # Configure the CampaignLabelService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignLabelService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignLabelService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_label_service_stub.universe_domain + end + + ## + # Create a new CampaignLabelService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignLabelService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_label_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_label_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates and removes campaign-label relationships. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_campaign_labels(request, options = nil) + # Pass arguments to `mutate_campaign_labels` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_labels(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_campaign_labels` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. ID of the customer whose campaign-label relationships are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignLabelOperation, ::Hash>] + # Required. The list of operations to perform on campaign-label + # relationships. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsRequest.new + # + # # Call the mutate_campaign_labels method. + # result = client.mutate_campaign_labels request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsResponse. + # p result + # + def mutate_campaign_labels request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_labels.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_labels.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_labels.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_label_service_stub.call_rpc :mutate_campaign_labels, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignLabelService API. + # + # This class represents the configuration for CampaignLabelService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_labels to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_labels.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignLabelService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_labels.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignLabelService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_labels` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_labels + + # @private + def initialize parent_rpcs = nil + mutate_campaign_labels_config = parent_rpcs.mutate_campaign_labels if parent_rpcs.respond_to? :mutate_campaign_labels + @mutate_campaign_labels = ::Gapic::Config::Method.new mutate_campaign_labels_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_label_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_label_service/credentials.rb new file mode 100644 index 000000000..ff610fc30 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_label_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignLabelService + # Credentials for the CampaignLabelService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_label_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_label_service/paths.rb new file mode 100644 index 000000000..3ba9aa358 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_label_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignLabelService + # Path helper methods for the CampaignLabelService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignLabels/{campaign_id}~{label_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param label_id [String] + # + # @return [::String] + def campaign_label_path customer_id:, campaign_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignLabels/#{campaign_id}~#{label_id}" + end + + ## + # Create a fully-qualified Label resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/labels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/labels/#{label_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_label_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_label_service_pb.rb new file mode 100644 index 000000000..c63b71a68 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_label_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_label_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/campaign_label_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/campaign_label_service.proto\x12!google.ads.googleads.v16.services\x1a\x37google/ads/googleads/v16/resources/campaign_label.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xbb\x01\n\x1bMutateCampaignLabelsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\noperations\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.CampaignLabelOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xa9\x01\n\x16\x43\x61mpaignLabelOperation\x12\x43\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignLabelH\x00\x12=\n\x06remove\x18\x02 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CampaignLabelH\x00\x42\x0b\n\toperation\"\xa0\x01\n\x1cMutateCampaignLabelsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12M\n\x07results\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.MutateCampaignLabelResult\"_\n\x19MutateCampaignLabelResult\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CampaignLabel2\xd1\x02\n\x14\x43\x61mpaignLabelService\x12\xf1\x01\n\x14MutateCampaignLabels\x12>.google.ads.googleads.v16.services.MutateCampaignLabelsRequest\x1a?.google.ads.googleads.v16.services.MutateCampaignLabelsResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/campaignLabels:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x85\x02\n%com.google.ads.googleads.v16.servicesB\x19\x43\x61mpaignLabelServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CampaignLabel", "google/ads/googleads/v16/resources/campaign_label.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignLabelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignLabelsRequest").msgclass + CampaignLabelOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignLabelOperation").msgclass + MutateCampaignLabelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignLabelsResponse").msgclass + MutateCampaignLabelResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignLabelResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_label_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_label_service_services_pb.rb new file mode 100644 index 000000000..45d331574 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_label_service_services_pb.rb @@ -0,0 +1,63 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_label_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_label_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignLabelService + # Proto file describing the Campaign Label service. + # + # Service to manage labels on campaigns. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignLabelService' + + # Creates and removes campaign-label relationships. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCampaignLabels, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignLabelsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service.rb b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service.rb new file mode 100644 index 000000000..b50fd3c1a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/credentials" +require "google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/paths" +require "google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to configure campaign lifecycle goals. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_lifecycle_goal_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client.new + # + module CampaignLifecycleGoalService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_lifecycle_goal_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/client.rb new file mode 100644 index 000000000..6d64052bd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/client.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_lifecycle_goal_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignLifecycleGoalService + ## + # Client for the CampaignLifecycleGoalService service. + # + # Service to configure campaign lifecycle goals. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_lifecycle_goal_service_stub + + ## + # Configure the CampaignLifecycleGoalService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignLifecycleGoalService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignLifecycleGoalService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_lifecycle_goal_service_stub.universe_domain + end + + ## + # Create a new CampaignLifecycleGoalService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignLifecycleGoalService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_lifecycle_goal_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_lifecycle_goal_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Process the given campaign lifecycle configurations. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignLifecycleGoalConfigError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload configure_campaign_lifecycle_goals(request, options = nil) + # Pass arguments to `configure_campaign_lifecycle_goals` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload configure_campaign_lifecycle_goals(customer_id: nil, operation: nil, validate_only: nil) + # Pass arguments to `configure_campaign_lifecycle_goals` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer performing the upload. + # @param operation [::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalOperation, ::Hash] + # Required. The operation to perform campaign lifecycle goal update. + # @param validate_only [::Boolean] + # Optional. If true, the request is validated but not executed. Only errors + # are returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsRequest.new + # + # # Call the configure_campaign_lifecycle_goals method. + # result = client.configure_campaign_lifecycle_goals request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsResponse. + # p result + # + def configure_campaign_lifecycle_goals request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.configure_campaign_lifecycle_goals.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.configure_campaign_lifecycle_goals.timeout, + metadata: metadata, + retry_policy: @config.rpcs.configure_campaign_lifecycle_goals.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_lifecycle_goal_service_stub.call_rpc :configure_campaign_lifecycle_goals, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignLifecycleGoalService API. + # + # This class represents the configuration for CampaignLifecycleGoalService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # configure_campaign_lifecycle_goals to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.configure_campaign_lifecycle_goals.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignLifecycleGoalService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.configure_campaign_lifecycle_goals.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignLifecycleGoalService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `configure_campaign_lifecycle_goals` + # @return [::Gapic::Config::Method] + # + attr_reader :configure_campaign_lifecycle_goals + + # @private + def initialize parent_rpcs = nil + configure_campaign_lifecycle_goals_config = parent_rpcs.configure_campaign_lifecycle_goals if parent_rpcs.respond_to? :configure_campaign_lifecycle_goals + @configure_campaign_lifecycle_goals = ::Gapic::Config::Method.new configure_campaign_lifecycle_goals_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/credentials.rb new file mode 100644 index 000000000..3e09cdcac --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignLifecycleGoalService + # Credentials for the CampaignLifecycleGoalService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/paths.rb new file mode 100644 index 000000000..99c17a353 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignLifecycleGoalService + # Path helper methods for the CampaignLifecycleGoalService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignLifecycleGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignLifecycleGoals/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_lifecycle_goal_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignLifecycleGoals/#{campaign_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service_pb.rb new file mode 100644 index 000000000..3728ca5a4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_lifecycle_goal_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/campaign_lifecycle_goal_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/services/campaign_lifecycle_goal_service.proto\x12!google.ads.googleads.v16.services\x1a@google/ads/googleads/v16/resources/campaign_lifecycle_goal.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xb9\x01\n&ConfigureCampaignLifecycleGoalsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Y\n\toperation\x18\x02 \x01(\x0b\x32\x41.google.ads.googleads.v16.services.CampaignLifecycleGoalOperationB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xfd\x01\n\x1e\x43\x61mpaignLifecycleGoalOperation\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12K\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.CampaignLifecycleGoalH\x00\x12K\n\x06update\x18\x03 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.CampaignLifecycleGoalH\x00\x42\x0b\n\toperation\"\x83\x01\n\'ConfigureCampaignLifecycleGoalsResponse\x12X\n\x06result\x18\x01 \x01(\x0b\x32H.google.ads.googleads.v16.services.ConfigureCampaignLifecycleGoalsResult\"s\n%ConfigureCampaignLifecycleGoalsResult\x12J\n\rresource_name\x18\x01 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/CampaignLifecycleGoal2\x99\x03\n\x1c\x43\x61mpaignLifecycleGoalService\x12\xb1\x02\n\x1f\x43onfigureCampaignLifecycleGoals\x12I.google.ads.googleads.v16.services.ConfigureCampaignLifecycleGoalsRequest\x1aJ.google.ads.googleads.v16.services.ConfigureCampaignLifecycleGoalsResponse\"w\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02Y\"T/v16/customers/{customer_id=*}/campaignLifecycleGoal:configureCampaignLifecycleGoals:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8d\x02\n%com.google.ads.googleads.v16.servicesB!CampaignLifecycleGoalServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CampaignLifecycleGoal", "google/ads/googleads/v16/resources/campaign_lifecycle_goal.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + ConfigureCampaignLifecycleGoalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConfigureCampaignLifecycleGoalsRequest").msgclass + CampaignLifecycleGoalOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignLifecycleGoalOperation").msgclass + ConfigureCampaignLifecycleGoalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConfigureCampaignLifecycleGoalsResponse").msgclass + ConfigureCampaignLifecycleGoalsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConfigureCampaignLifecycleGoalsResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service_services_pb.rb new file mode 100644 index 000000000..eacf9b544 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_lifecycle_goal_service_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_lifecycle_goal_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_lifecycle_goal_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignLifecycleGoalService + # Service to configure campaign lifecycle goals. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignLifecycleGoalService' + + # Process the given campaign lifecycle configurations. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignLifecycleGoalConfigError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :ConfigureCampaignLifecycleGoals, ::Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsRequest, ::Google::Ads::GoogleAds::V16::Services::ConfigureCampaignLifecycleGoalsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_service.rb b/lib/google/ads/google_ads/v16/services/campaign_service.rb new file mode 100644 index 000000000..93d363056 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_service/credentials" +require "google/ads/google_ads/v16/services/campaign_service/paths" +require "google/ads/google_ads/v16/services/campaign_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaigns. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignService::Client.new + # + module CampaignService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_service/client.rb new file mode 100644 index 000000000..ea294e47d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_service/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignService + ## + # Client for the CampaignService service. + # + # Service to manage campaigns. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_service_stub + + ## + # Configure the CampaignService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_service_stub.universe_domain + end + + ## + # Create a new CampaignService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes campaigns. Operation statuses are returned. + # + # List of thrown errors: + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [BiddingStrategyError]() + # [CampaignBudgetError]() + # [CampaignError]() + # [ContextError]() + # [DatabaseError]() + # [DateError]() + # [DateRangeError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotAllowlistedError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RegionCodeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SettingError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # + # @overload mutate_campaigns(request, options = nil) + # Pass arguments to `mutate_campaigns` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaigns(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaigns` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaigns are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignOperation, ::Hash>] + # Required. The list of operations to perform on individual campaigns. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignsRequest.new + # + # # Call the mutate_campaigns method. + # result = client.mutate_campaigns request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignsResponse. + # p result + # + def mutate_campaigns request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaigns.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaigns.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaigns.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_service_stub.call_rpc :mutate_campaigns, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignService API. + # + # This class represents the configuration for CampaignService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaigns to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaigns.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaigns.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaigns` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaigns + + # @private + def initialize parent_rpcs = nil + mutate_campaigns_config = parent_rpcs.mutate_campaigns if parent_rpcs.respond_to? :mutate_campaigns + @mutate_campaigns = ::Gapic::Config::Method.new mutate_campaigns_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_service/credentials.rb new file mode 100644 index 000000000..8a941bee0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignService + # Credentials for the CampaignService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_service/paths.rb new file mode 100644 index 000000000..3a762e94b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_service/paths.rb @@ -0,0 +1,190 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignService + # Path helper methods for the CampaignService API. + module Paths + ## + # Create a fully-qualified AccessibleBiddingStrategy resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accessibleBiddingStrategies/{bidding_strategy_id}` + # + # @param customer_id [String] + # @param bidding_strategy_id [String] + # + # @return [::String] + def accessible_bidding_strategy_path customer_id:, bidding_strategy_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accessibleBiddingStrategies/#{bidding_strategy_id}" + end + + ## + # Create a fully-qualified AssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSets/#{asset_set_id}" + end + + ## + # Create a fully-qualified BiddingStrategy resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingStrategies/{bidding_strategy_id}` + # + # @param customer_id [String] + # @param bidding_strategy_id [String] + # + # @return [::String] + def bidding_strategy_path customer_id:, bidding_strategy_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingStrategies/#{bidding_strategy_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignBudget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBudgets/{campaign_budget_id}` + # + # @param customer_id [String] + # @param campaign_budget_id [String] + # + # @return [::String] + def campaign_budget_path customer_id:, campaign_budget_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBudgets/#{campaign_budget_id}" + end + + ## + # Create a fully-qualified CampaignGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignGroups/{campaign_group_id}` + # + # @param customer_id [String] + # @param campaign_group_id [String] + # + # @return [::String] + def campaign_group_path customer_id:, campaign_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignGroups/#{campaign_group_id}" + end + + ## + # Create a fully-qualified CampaignLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignLabels/{campaign_id}~{label_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param label_id [String] + # + # @return [::String] + def campaign_label_path customer_id:, campaign_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignLabels/#{campaign_id}~#{label_id}" + end + + ## + # Create a fully-qualified ConversionAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionActions/{conversion_action_id}` + # + # @param customer_id [String] + # @param conversion_action_id [String] + # + # @return [::String] + def conversion_action_path customer_id:, conversion_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionActions/#{conversion_action_id}" + end + + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_service_pb.rb new file mode 100644 index 000000000..871505d7b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/services/campaign_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x31google/ads/googleads/v16/resources/campaign.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x9d\x02\n\x16MutateCampaignsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12M\n\noperations\x18\x02 \x03(\x0b\x32\x34.google.ads.googleads.v16.services.CampaignOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x8b\x02\n\x11\x43\x61mpaignOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12>\n\x06\x63reate\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.CampaignH\x00\x12>\n\x06update\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.CampaignH\x00\x12\x38\n\x06remove\x18\x03 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/CampaignH\x00\x42\x0b\n\toperation\"\x96\x01\n\x17MutateCampaignsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12H\n\x07results\x18\x02 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.MutateCampaignResult\"\x95\x01\n\x14MutateCampaignResult\x12=\n\rresource_name\x18\x01 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/Campaign\x12>\n\x08\x63\x61mpaign\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.Campaign2\xb8\x02\n\x0f\x43\x61mpaignService\x12\xdd\x01\n\x0fMutateCampaigns\x12\x39.google.ads.googleads.v16.services.MutateCampaignsRequest\x1a:.google.ads.googleads.v16.services.MutateCampaignsResponse\"S\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x34\"//v16/customers/{customer_id=*}/campaigns:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x80\x02\n%com.google.ads.googleads.v16.servicesB\x14\x43\x61mpaignServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.Campaign", "google/ads/googleads/v16/resources/campaign.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCampaignsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignsRequest").msgclass + CampaignOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignOperation").msgclass + MutateCampaignsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignsResponse").msgclass + MutateCampaignResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCampaignResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_service_services_pb.rb new file mode 100644 index 000000000..7452dd5a9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_service_services_pb.rb @@ -0,0 +1,86 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/campaign_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/campaign_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignService + # Proto file describing the Campaign service. + # + # Service to manage campaigns. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CampaignService' + + # Creates, updates, or removes campaigns. Operation statuses are returned. + # + # List of thrown errors: + # [AdxError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [BiddingStrategyError]() + # [CampaignBudgetError]() + # [CampaignError]() + # [ContextError]() + # [DatabaseError]() + # [DateError]() + # [DateRangeError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotAllowlistedError]() + # [NotEmptyError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RegionCodeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SettingError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateCampaigns, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCampaignsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_shared_set_service.rb b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service.rb new file mode 100644 index 000000000..7b44cf19b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/campaign_shared_set_service/credentials" +require "google/ads/google_ads/v16/services/campaign_shared_set_service/paths" +require "google/ads/google_ads/v16/services/campaign_shared_set_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage campaign shared sets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/campaign_shared_set_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client.new + # + module CampaignSharedSetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "campaign_shared_set_service", "helpers.rb" +require "google/ads/google_ads/v16/services/campaign_shared_set_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/client.rb b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/client.rb new file mode 100644 index 000000000..d203b121e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/client.rb @@ -0,0 +1,463 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/campaign_shared_set_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignSharedSetService + ## + # Client for the CampaignSharedSetService service. + # + # Service to manage campaign shared sets. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :campaign_shared_set_service_stub + + ## + # Configure the CampaignSharedSetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CampaignSharedSetService clients + # ::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CampaignSharedSetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @campaign_shared_set_service_stub.universe_domain + end + + ## + # Create a new CampaignSharedSetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CampaignSharedSetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/campaign_shared_set_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @campaign_shared_set_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or removes campaign shared sets. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CampaignSharedSetError]() + # [ContextError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_campaign_shared_sets(request, options = nil) + # Pass arguments to `mutate_campaign_shared_sets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCampaignSharedSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCampaignSharedSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_campaign_shared_sets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_campaign_shared_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign shared sets are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetOperation, ::Hash>] + # Required. The list of operations to perform on individual campaign shared + # sets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCampaignSharedSetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCampaignSharedSetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCampaignSharedSetsRequest.new + # + # # Call the mutate_campaign_shared_sets method. + # result = client.mutate_campaign_shared_sets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCampaignSharedSetsResponse. + # p result + # + def mutate_campaign_shared_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCampaignSharedSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_campaign_shared_sets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_campaign_shared_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_campaign_shared_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @campaign_shared_set_service_stub.call_rpc :mutate_campaign_shared_sets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CampaignSharedSetService API. + # + # This class represents the configuration for CampaignSharedSetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_campaign_shared_sets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_shared_sets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CampaignSharedSetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_campaign_shared_sets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CampaignSharedSetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_campaign_shared_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_campaign_shared_sets + + # @private + def initialize parent_rpcs = nil + mutate_campaign_shared_sets_config = parent_rpcs.mutate_campaign_shared_sets if parent_rpcs.respond_to? :mutate_campaign_shared_sets + @mutate_campaign_shared_sets = ::Gapic::Config::Method.new mutate_campaign_shared_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/credentials.rb b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/credentials.rb new file mode 100644 index 000000000..370da4c0d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignSharedSetService + # Credentials for the CampaignSharedSetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/paths.rb b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/paths.rb new file mode 100644 index 000000000..f59c6567e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CampaignSharedSetService + # Path helper methods for the CampaignSharedSetService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignSharedSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignSharedSets/{campaign_id}~{shared_set_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param shared_set_id [String] + # + # @return [::String] + def campaign_shared_set_path customer_id:, campaign_id:, shared_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignSharedSets/#{campaign_id}~#{shared_set_id}" + end + + ## + # Create a fully-qualified SharedSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/sharedSets/{shared_set_id}` + # + # @param customer_id [String] + # @param shared_set_id [String] + # + # @return [::String] + def shared_set_path customer_id:, shared_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/sharedSets/#{shared_set_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/campaign_shared_set_service_pb.rb b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service_pb.rb new file mode 100644 index 000000000..3355f4017 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/campaign_shared_set_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/campaign_shared_set_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/campaign_shared_set_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/services/campaign_shared_set_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a] + # Required. The list of operations to perform on individual conversion + # actions. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateConversionActionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateConversionActionsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ConversionActionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateConversionActionsRequest.new + # + # # Call the mutate_conversion_actions method. + # result = client.mutate_conversion_actions request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateConversionActionsResponse. + # p result + # + def mutate_conversion_actions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateConversionActionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_conversion_actions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_conversion_actions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_conversion_actions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversion_action_service_stub.call_rpc :mutate_conversion_actions, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ConversionActionService API. + # + # This class represents the configuration for ConversionActionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ConversionActionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_conversion_actions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ConversionActionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_actions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionActionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_actions.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ConversionActionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_conversion_actions` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_conversion_actions + + # @private + def initialize parent_rpcs = nil + mutate_conversion_actions_config = parent_rpcs.mutate_conversion_actions if parent_rpcs.respond_to? :mutate_conversion_actions + @mutate_conversion_actions = ::Gapic::Config::Method.new mutate_conversion_actions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_action_service/credentials.rb b/lib/google/ads/google_ads/v16/services/conversion_action_service/credentials.rb new file mode 100644 index 000000000..bce42873e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_action_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionActionService + # Credentials for the ConversionActionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_action_service/paths.rb b/lib/google/ads/google_ads/v16/services/conversion_action_service/paths.rb new file mode 100644 index 000000000..c05cd42a6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_action_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionActionService + # Path helper methods for the ConversionActionService API. + module Paths + ## + # Create a fully-qualified ConversionAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionActions/{conversion_action_id}` + # + # @param customer_id [String] + # @param conversion_action_id [String] + # + # @return [::String] + def conversion_action_path customer_id:, conversion_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionActions/#{conversion_action_id}" + end + + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_action_service_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_action_service_pb.rb new file mode 100644 index 000000000..44e812b98 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_action_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/conversion_action_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/conversion_action_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/services/conversion_action_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a:google/ads/googleads/v16/resources/conversion_action.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xad\x02\n\x1eMutateConversionActionsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12U\n\noperations\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.ConversionActionOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xab\x02\n\x19\x43onversionActionOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x46\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.ConversionActionH\x00\x12\x46\n\x06update\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.ConversionActionH\x00\x12@\n\x06remove\x18\x03 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/ConversionActionH\x00\x42\x0b\n\toperation\"\xa6\x01\n\x1fMutateConversionActionsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12P\n\x07results\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.services.MutateConversionActionResult\"\xb6\x01\n\x1cMutateConversionActionResult\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/ConversionAction\x12O\n\x11\x63onversion_action\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.ConversionAction2\xe0\x02\n\x17\x43onversionActionService\x12\xfd\x01\n\x17MutateConversionActions\x12\x41.google.ads.googleads.v16.services.MutateConversionActionsRequest\x1a\x42.google.ads.googleads.v16.services.MutateConversionActionsResponse\"[\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02<\"7/v16/customers/{customer_id=*}/conversionActions:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x88\x02\n%com.google.ads.googleads.v16.servicesB\x1c\x43onversionActionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.ConversionAction", "google/ads/googleads/v16/resources/conversion_action.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateConversionActionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionActionsRequest").msgclass + ConversionActionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConversionActionOperation").msgclass + MutateConversionActionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionActionsResponse").msgclass + MutateConversionActionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionActionResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_action_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_action_service_services_pb.rb new file mode 100644 index 000000000..345d9ad42 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_action_service_services_pb.rb @@ -0,0 +1,68 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/conversion_action_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/conversion_action_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionActionService + # Proto file describing the Conversion Action service. + # + # Service to manage conversion actions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ConversionActionService' + + # Creates, updates or removes conversion actions. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ConversionActionError]() + # [CurrencyCodeError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [StringLengthError]() + rpc :MutateConversionActions, ::Google::Ads::GoogleAds::V16::Services::MutateConversionActionsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateConversionActionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service.rb b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service.rb new file mode 100644 index 000000000..a23350d34 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/conversion_adjustment_upload_service/credentials" +require "google/ads/google_ads/v16/services/conversion_adjustment_upload_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to upload conversion adjustments. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/conversion_adjustment_upload_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client.new + # + module ConversionAdjustmentUploadService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversion_adjustment_upload_service", "helpers.rb" +require "google/ads/google_ads/v16/services/conversion_adjustment_upload_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service/client.rb b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service/client.rb new file mode 100644 index 000000000..d72e143ef --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service/client.rb @@ -0,0 +1,450 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/conversion_adjustment_upload_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionAdjustmentUploadService + ## + # Client for the ConversionAdjustmentUploadService service. + # + # Service to upload conversion adjustments. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :conversion_adjustment_upload_service_stub + + ## + # Configure the ConversionAdjustmentUploadService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversionAdjustmentUploadService clients + # ::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversionAdjustmentUploadService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @conversion_adjustment_upload_service_stub.universe_domain + end + + ## + # Create a new ConversionAdjustmentUploadService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversionAdjustmentUploadService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/conversion_adjustment_upload_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @conversion_adjustment_upload_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Processes the given conversion adjustments. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [PartialFailureError]() + # [QuotaError]() + # [RequestError]() + # + # @overload upload_conversion_adjustments(request, options = nil) + # Pass arguments to `upload_conversion_adjustments` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upload_conversion_adjustments(customer_id: nil, conversion_adjustments: nil, partial_failure: nil, validate_only: nil, job_id: nil) + # Pass arguments to `upload_conversion_adjustments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer performing the upload. + # @param conversion_adjustments [::Array<::Google::Ads::GoogleAds::V16::Services::ConversionAdjustment, ::Hash>] + # Required. The conversion adjustments that are being uploaded. + # @param partial_failure [::Boolean] + # Required. If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried out + # in one transaction if and only if they are all valid. This should always be + # set to true. + # See + # https://developers.google.com/google-ads/api/docs/best-practices/partial-failures + # for more information about partial failure. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param job_id [::Integer] + # Optional. Optional input to set job ID. Must be a non-negative number that + # is less than 2^31 if provided. If this field is not provided, the API will + # generate a job ID in the range [2^31, (2^63)-1]. The API will return the + # value for this request in the `job_id` field of the + # `UploadConversionAdjustmentsResponse`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsRequest.new + # + # # Call the upload_conversion_adjustments method. + # result = client.upload_conversion_adjustments request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsResponse. + # p result + # + def upload_conversion_adjustments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.upload_conversion_adjustments.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.upload_conversion_adjustments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_conversion_adjustments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversion_adjustment_upload_service_stub.call_rpc :upload_conversion_adjustments, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ConversionAdjustmentUploadService API. + # + # This class represents the configuration for ConversionAdjustmentUploadService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # upload_conversion_adjustments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.upload_conversion_adjustments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionAdjustmentUploadService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.upload_conversion_adjustments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ConversionAdjustmentUploadService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `upload_conversion_adjustments` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_conversion_adjustments + + # @private + def initialize parent_rpcs = nil + upload_conversion_adjustments_config = parent_rpcs.upload_conversion_adjustments if parent_rpcs.respond_to? :upload_conversion_adjustments + @upload_conversion_adjustments = ::Gapic::Config::Method.new upload_conversion_adjustments_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service/credentials.rb b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service/credentials.rb new file mode 100644 index 000000000..792dd08f3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionAdjustmentUploadService + # Credentials for the ConversionAdjustmentUploadService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service_pb.rb new file mode 100644 index 000000000..4fef3b3e5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/conversion_adjustment_upload_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/offline_user_data_pb' +require 'google/ads/google_ads/v16/enums/conversion_adjustment_type_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nLgoogle/ads/googleads/v16/services/conversion_adjustment_upload_service.proto\x12!google.ads.googleads.v16.services\x1a\x37google/ads/googleads/v16/common/offline_user_data.proto\x1a?google/ads/googleads/v16/enums/conversion_adjustment_type.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x17google/rpc/status.proto\"\xf6\x01\n\"UploadConversionAdjustmentsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\\\n\x16\x63onversion_adjustments\x18\x02 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.ConversionAdjustmentB\x03\xe0\x41\x02\x12\x1c\n\x0fpartial_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12\x18\n\x06job_id\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\t\n\x07_job_id\"\xb8\x01\n#UploadConversionAdjustmentsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12N\n\x07results\x18\x02 \x03(\x0b\x32=.google.ads.googleads.v16.services.ConversionAdjustmentResult\x12\x0e\n\x06job_id\x18\x03 \x01(\x03\"\xb3\x04\n\x14\x43onversionAdjustment\x12R\n\x14gclid_date_time_pair\x18\x0c \x01(\x0b\x32\x34.google.ads.googleads.v16.services.GclidDateTimePair\x12\x15\n\x08order_id\x18\r \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x11\x63onversion_action\x18\x08 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x61\x64justment_date_time\x18\t \x01(\tH\x02\x88\x01\x01\x12n\n\x0f\x61\x64justment_type\x18\x05 \x01(\x0e\x32U.google.ads.googleads.v16.enums.ConversionAdjustmentTypeEnum.ConversionAdjustmentType\x12N\n\x11restatement_value\x18\x06 \x01(\x0b\x32\x33.google.ads.googleads.v16.services.RestatementValue\x12I\n\x10user_identifiers\x18\n \x03(\x0b\x32/.google.ads.googleads.v16.common.UserIdentifier\x12\x17\n\nuser_agent\x18\x0b \x01(\tH\x03\x88\x01\x01\x42\x0b\n\t_order_idB\x14\n\x12_conversion_actionB\x17\n\x15_adjustment_date_timeB\r\n\x0b_user_agent\"p\n\x10RestatementValue\x12\x1b\n\x0e\x61\x64justed_value\x18\x03 \x01(\x01H\x00\x88\x01\x01\x12\x1a\n\rcurrency_code\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x11\n\x0f_adjusted_valueB\x10\n\x0e_currency_code\"m\n\x11GclidDateTimePair\x12\x12\n\x05gclid\x18\x03 \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63onversion_date_time\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_gclidB\x17\n\x15_conversion_date_time\"\xe4\x02\n\x1a\x43onversionAdjustmentResult\x12R\n\x14gclid_date_time_pair\x18\t \x01(\x0b\x32\x34.google.ads.googleads.v16.services.GclidDateTimePair\x12\x10\n\x08order_id\x18\n \x01(\t\x12\x1e\n\x11\x63onversion_action\x18\x07 \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x61\x64justment_date_time\x18\x08 \x01(\tH\x01\x88\x01\x01\x12n\n\x0f\x61\x64justment_type\x18\x05 \x01(\x0e\x32U.google.ads.googleads.v16.enums.ConversionAdjustmentTypeEnum.ConversionAdjustmentTypeB\x14\n\x12_conversion_actionB\x17\n\x15_adjustment_date_time2\x95\x03\n!ConversionAdjustmentUploadService\x12\xa8\x02\n\x1bUploadConversionAdjustments\x12\x45.google.ads.googleads.v16.services.UploadConversionAdjustmentsRequest\x1a\x46.google.ads.googleads.v16.services.UploadConversionAdjustmentsResponse\"z\xda\x41\x32\x63ustomer_id,conversion_adjustments,partial_failure\x82\xd3\xe4\x93\x02?\":/v16/customers/{customer_id=*}:uploadConversionAdjustments:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x92\x02\n%com.google.ads.googleads.v16.servicesB&ConversionAdjustmentUploadServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.ads.googleads.v16.common.UserIdentifier", "google/ads/googleads/v16/common/offline_user_data.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + UploadConversionAdjustmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UploadConversionAdjustmentsRequest").msgclass + UploadConversionAdjustmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UploadConversionAdjustmentsResponse").msgclass + ConversionAdjustment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConversionAdjustment").msgclass + RestatementValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.RestatementValue").msgclass + GclidDateTimePair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GclidDateTimePair").msgclass + ConversionAdjustmentResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConversionAdjustmentResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service_services_pb.rb new file mode 100644 index 000000000..fb6eb56ed --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_adjustment_upload_service_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/conversion_adjustment_upload_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/conversion_adjustment_upload_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionAdjustmentUploadService + # Service to upload conversion adjustments. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ConversionAdjustmentUploadService' + + # Processes the given conversion adjustments. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [PartialFailureError]() + # [QuotaError]() + # [RequestError]() + rpc :UploadConversionAdjustments, ::Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsRequest, ::Google::Ads::GoogleAds::V16::Services::UploadConversionAdjustmentsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service.rb b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service.rb new file mode 100644 index 000000000..de61a7e6e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/conversion_custom_variable_service/credentials" +require "google/ads/google_ads/v16/services/conversion_custom_variable_service/paths" +require "google/ads/google_ads/v16/services/conversion_custom_variable_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage conversion custom variables. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/conversion_custom_variable_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client.new + # + module ConversionCustomVariableService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversion_custom_variable_service", "helpers.rb" +require "google/ads/google_ads/v16/services/conversion_custom_variable_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/client.rb b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/client.rb new file mode 100644 index 000000000..c743c22cd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/client.rb @@ -0,0 +1,450 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/conversion_custom_variable_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionCustomVariableService + ## + # Client for the ConversionCustomVariableService service. + # + # Service to manage conversion custom variables. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversion_custom_variable_service_stub + + ## + # Configure the ConversionCustomVariableService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversionCustomVariableService clients + # ::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversionCustomVariableService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @conversion_custom_variable_service_stub.universe_domain + end + + ## + # Create a new ConversionCustomVariableService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversionCustomVariableService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/conversion_custom_variable_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @conversion_custom_variable_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or updates conversion custom variables. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ConversionCustomVariableError]() + # [DatabaseError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_conversion_custom_variables(request, options = nil) + # Pass arguments to `mutate_conversion_custom_variables` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_conversion_custom_variables(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_conversion_custom_variables` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose conversion custom variables are + # being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableOperation, ::Hash>] + # Required. The list of operations to perform on individual conversion custom + # variables. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesRequest.new + # + # # Call the mutate_conversion_custom_variables method. + # result = client.mutate_conversion_custom_variables request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesResponse. + # p result + # + def mutate_conversion_custom_variables request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_conversion_custom_variables.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_conversion_custom_variables.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_conversion_custom_variables.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversion_custom_variable_service_stub.call_rpc :mutate_conversion_custom_variables, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ConversionCustomVariableService API. + # + # This class represents the configuration for ConversionCustomVariableService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_conversion_custom_variables to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_custom_variables.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionCustomVariableService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_custom_variables.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ConversionCustomVariableService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_conversion_custom_variables` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_conversion_custom_variables + + # @private + def initialize parent_rpcs = nil + mutate_conversion_custom_variables_config = parent_rpcs.mutate_conversion_custom_variables if parent_rpcs.respond_to? :mutate_conversion_custom_variables + @mutate_conversion_custom_variables = ::Gapic::Config::Method.new mutate_conversion_custom_variables_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/credentials.rb b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/credentials.rb new file mode 100644 index 000000000..fa0ead60e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionCustomVariableService + # Credentials for the ConversionCustomVariableService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/paths.rb b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/paths.rb new file mode 100644 index 000000000..2570be90e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionCustomVariableService + # Path helper methods for the ConversionCustomVariableService API. + module Paths + ## + # Create a fully-qualified ConversionCustomVariable resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionCustomVariables/{conversion_custom_variable_id}` + # + # @param customer_id [String] + # @param conversion_custom_variable_id [String] + # + # @return [::String] + def conversion_custom_variable_path customer_id:, conversion_custom_variable_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionCustomVariables/#{conversion_custom_variable_id}" + end + + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service_pb.rb new file mode 100644 index 000000000..94f2088cd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/conversion_custom_variable_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/conversion_custom_variable_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nJgoogle/ads/googleads/v16/services/conversion_custom_variable_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x43google/ads/googleads/v16/resources/conversion_custom_variable.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xbd\x02\n&MutateConversionCustomVariablesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12]\n\noperations\x18\x02 \x03(\x0b\x32\x44.google.ads.googleads.v16.services.ConversionCustomVariableOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x81\x02\n!ConversionCustomVariableOperation\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12N\n\x06\x63reate\x18\x01 \x01(\x0b\x32<.google.ads.googleads.v16.resources.ConversionCustomVariableH\x00\x12N\n\x06update\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.resources.ConversionCustomVariableH\x00\x42\x0b\n\toperation\"\xb6\x01\n\'MutateConversionCustomVariablesResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12X\n\x07results\x18\x02 \x03(\x0b\x32G.google.ads.googleads.v16.services.MutateConversionCustomVariableResult\"\xd7\x01\n$MutateConversionCustomVariableResult\x12M\n\rresource_name\x18\x01 \x01(\tB6\xfa\x41\x33\n1googleads.googleapis.com/ConversionCustomVariable\x12`\n\x1a\x63onversion_custom_variable\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.resources.ConversionCustomVariable2\x88\x03\n\x1f\x43onversionCustomVariableService\x12\x9d\x02\n\x1fMutateConversionCustomVariables\x12I.google.ads.googleads.v16.services.MutateConversionCustomVariablesRequest\x1aJ.google.ads.googleads.v16.services.MutateConversionCustomVariablesResponse\"c\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x44\"?/v16/customers/{customer_id=*}/conversionCustomVariables:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x90\x02\n%com.google.ads.googleads.v16.servicesB$ConversionCustomVariableServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.ConversionCustomVariable", "google/ads/googleads/v16/resources/conversion_custom_variable.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateConversionCustomVariablesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionCustomVariablesRequest").msgclass + ConversionCustomVariableOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConversionCustomVariableOperation").msgclass + MutateConversionCustomVariablesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionCustomVariablesResponse").msgclass + MutateConversionCustomVariableResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionCustomVariableResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service_services_pb.rb new file mode 100644 index 000000000..4046e8875 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_custom_variable_service_services_pb.rb @@ -0,0 +1,60 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/conversion_custom_variable_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/conversion_custom_variable_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionCustomVariableService + # Proto file describing the Conversion Custom Variable service. + # + # Service to manage conversion custom variables. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ConversionCustomVariableService' + + # Creates or updates conversion custom variables. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ConversionCustomVariableError]() + # [DatabaseError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateConversionCustomVariables, ::Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesRequest, ::Google::Ads::GoogleAds::V16::Services::MutateConversionCustomVariablesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service.rb b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service.rb new file mode 100644 index 000000000..546b8e909 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/credentials" +require "google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/paths" +require "google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage conversion goal campaign config. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/conversion_goal_campaign_config_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client.new + # + module ConversionGoalCampaignConfigService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversion_goal_campaign_config_service", "helpers.rb" +require "google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/client.rb b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/client.rb new file mode 100644 index 000000000..2e26a6008 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/client.rb @@ -0,0 +1,435 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionGoalCampaignConfigService + ## + # Client for the ConversionGoalCampaignConfigService service. + # + # Service to manage conversion goal campaign config. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversion_goal_campaign_config_service_stub + + ## + # Configure the ConversionGoalCampaignConfigService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversionGoalCampaignConfigService clients + # ::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversionGoalCampaignConfigService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @conversion_goal_campaign_config_service_stub.universe_domain + end + + ## + # Create a new ConversionGoalCampaignConfigService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversionGoalCampaignConfigService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @conversion_goal_campaign_config_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes conversion goal campaign config. Operation + # statuses are returned. + # + # @overload mutate_conversion_goal_campaign_configs(request, options = nil) + # Pass arguments to `mutate_conversion_goal_campaign_configs` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_conversion_goal_campaign_configs(customer_id: nil, operations: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_conversion_goal_campaign_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose custom conversion goals are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigOperation, ::Hash>] + # Required. The list of operations to perform on individual conversion goal + # campaign config. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsRequest.new + # + # # Call the mutate_conversion_goal_campaign_configs method. + # result = client.mutate_conversion_goal_campaign_configs request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsResponse. + # p result + # + def mutate_conversion_goal_campaign_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_conversion_goal_campaign_configs.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_conversion_goal_campaign_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_conversion_goal_campaign_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversion_goal_campaign_config_service_stub.call_rpc :mutate_conversion_goal_campaign_configs, + request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ConversionGoalCampaignConfigService API. + # + # This class represents the configuration for ConversionGoalCampaignConfigService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_conversion_goal_campaign_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_goal_campaign_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionGoalCampaignConfigService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_goal_campaign_configs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ConversionGoalCampaignConfigService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_conversion_goal_campaign_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_conversion_goal_campaign_configs + + # @private + def initialize parent_rpcs = nil + mutate_conversion_goal_campaign_configs_config = parent_rpcs.mutate_conversion_goal_campaign_configs if parent_rpcs.respond_to? :mutate_conversion_goal_campaign_configs + @mutate_conversion_goal_campaign_configs = ::Gapic::Config::Method.new mutate_conversion_goal_campaign_configs_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/credentials.rb b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/credentials.rb new file mode 100644 index 000000000..c955da695 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionGoalCampaignConfigService + # Credentials for the ConversionGoalCampaignConfigService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/paths.rb b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/paths.rb new file mode 100644 index 000000000..9dbf33123 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service/paths.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionGoalCampaignConfigService + # Path helper methods for the ConversionGoalCampaignConfigService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified ConversionGoalCampaignConfig resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionGoalCampaignConfigs/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def conversion_goal_campaign_config_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionGoalCampaignConfigs/#{campaign_id}" + end + + ## + # Create a fully-qualified CustomConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customConversionGoals/{goal_id}` + # + # @param customer_id [String] + # @param goal_id [String] + # + # @return [::String] + def custom_conversion_goal_path customer_id:, goal_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customConversionGoals/#{goal_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_pb.rb new file mode 100644 index 000000000..8234208f9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/conversion_goal_campaign_config_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/conversion_goal_campaign_config_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nOgoogle/ads/googleads/v16/services/conversion_goal_campaign_config_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1aHgoogle/ads/googleads/v16/resources/conversion_goal_campaign_config.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xac\x02\n*MutateConversionGoalCampaignConfigsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x61\n\noperations\x18\x02 \x03(\x0b\x32H.google.ads.googleads.v16.services.ConversionGoalCampaignConfigOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12j\n\x15response_content_type\x18\x04 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xb9\x01\n%ConversionGoalCampaignConfigOperation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12R\n\x06update\x18\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.ConversionGoalCampaignConfigH\x00\x42\x0b\n\toperation\"\x8b\x01\n+MutateConversionGoalCampaignConfigsResponse\x12\\\n\x07results\x18\x01 \x03(\x0b\x32K.google.ads.googleads.v16.services.MutateConversionGoalCampaignConfigResult\"\xe8\x01\n(MutateConversionGoalCampaignConfigResult\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xfa\x41\x37\n5googleads.googleapis.com/ConversionGoalCampaignConfig\x12i\n\x1f\x63onversion_goal_campaign_config\x18\x02 \x01(\x0b\x32@.google.ads.googleads.v16.resources.ConversionGoalCampaignConfig2\x9c\x03\n#ConversionGoalCampaignConfigService\x12\xad\x02\n#MutateConversionGoalCampaignConfigs\x12M.google.ads.googleads.v16.services.MutateConversionGoalCampaignConfigsRequest\x1aN.google.ads.googleads.v16.services.MutateConversionGoalCampaignConfigsResponse\"g\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02H\"C/v16/customers/{customer_id=*}/conversionGoalCampaignConfigs:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x94\x02\n%com.google.ads.googleads.v16.servicesB(ConversionGoalCampaignConfigServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.ConversionGoalCampaignConfig", "google/ads/googleads/v16/resources/conversion_goal_campaign_config.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateConversionGoalCampaignConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionGoalCampaignConfigsRequest").msgclass + ConversionGoalCampaignConfigOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConversionGoalCampaignConfigOperation").msgclass + MutateConversionGoalCampaignConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionGoalCampaignConfigsResponse").msgclass + MutateConversionGoalCampaignConfigResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionGoalCampaignConfigResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_services_pb.rb new file mode 100644 index 000000000..65e3c6a70 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/conversion_goal_campaign_config_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/conversion_goal_campaign_config_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionGoalCampaignConfigService + # Proto file describing the ConversionGoalCampaignConfig service. + # + # Service to manage conversion goal campaign config. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ConversionGoalCampaignConfigService' + + # Creates, updates or removes conversion goal campaign config. Operation + # statuses are returned. + rpc :MutateConversionGoalCampaignConfigs, ::Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateConversionGoalCampaignConfigsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_upload_service.rb b/lib/google/ads/google_ads/v16/services/conversion_upload_service.rb new file mode 100644 index 000000000..e7d5bcfe4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_upload_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/conversion_upload_service/credentials" +require "google/ads/google_ads/v16/services/conversion_upload_service/paths" +require "google/ads/google_ads/v16/services/conversion_upload_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to upload conversions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/conversion_upload_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client.new + # + module ConversionUploadService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversion_upload_service", "helpers.rb" +require "google/ads/google_ads/v16/services/conversion_upload_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/conversion_upload_service/client.rb b/lib/google/ads/google_ads/v16/services/conversion_upload_service/client.rb new file mode 100644 index 000000000..0622ee781 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_upload_service/client.rb @@ -0,0 +1,588 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/conversion_upload_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionUploadService + ## + # Client for the ConversionUploadService service. + # + # Service to upload conversions. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversion_upload_service_stub + + ## + # Configure the ConversionUploadService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversionUploadService clients + # ::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversionUploadService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @conversion_upload_service_stub.universe_domain + end + + ## + # Create a new ConversionUploadService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversionUploadService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/conversion_upload_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @conversion_upload_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Processes the given click conversions. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ConversionUploadError]() + # [HeaderError]() + # [InternalError]() + # [PartialFailureError]() + # [QuotaError]() + # [RequestError]() + # + # @overload upload_click_conversions(request, options = nil) + # Pass arguments to `upload_click_conversions` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::UploadClickConversionsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::UploadClickConversionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upload_click_conversions(customer_id: nil, conversions: nil, partial_failure: nil, validate_only: nil, debug_enabled: nil, job_id: nil) + # Pass arguments to `upload_click_conversions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer performing the upload. + # @param conversions [::Array<::Google::Ads::GoogleAds::V16::Services::ClickConversion, ::Hash>] + # Required. The conversions that are being uploaded. + # @param partial_failure [::Boolean] + # Required. If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # This should always be set to true. + # See + # https://developers.google.com/google-ads/api/docs/best-practices/partial-failures + # for more information about partial failure. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param debug_enabled [::Boolean] + # If true, the API will perform all upload checks and return errors if + # any are found. If false, it will perform only basic input validation, + # skip subsequent upload checks, and return success even if no click + # was found for the provided `user_identifiers`. + # + # This setting only affects Enhanced conversions for leads uploads that use + # `user_identifiers` instead of `GCLID`, `GBRAID`, or `WBRAID`. When + # uploading enhanced conversions for leads, you should upload all conversion + # events to the API, including those that may not come from Google Ads + # campaigns. The upload of an event that is not from a Google Ads campaign + # will result in a `CLICK_NOT_FOUND` error if this field is set to `true`. + # Since these errors are expected for such events, set this field to `false` + # so you can confirm your uploads are properly formatted but ignore + # `CLICK_NOT_FOUND` errors from all of the conversions that are not from a + # Google Ads campaign. This will allow you to focus only on errors that you + # can address. + # + # Default is false. + # @param job_id [::Integer] + # Optional. Optional input to set job ID. Must be a non-negative number that + # is less than 2^31 if provided. If this field is not provided, the API will + # generate a job ID in the range [2^31, (2^63)-1]. The API will return the + # value for this request in the `job_id` field of the + # `UploadClickConversionsResponse`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::UploadClickConversionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::UploadClickConversionsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::UploadClickConversionsRequest.new + # + # # Call the upload_click_conversions method. + # result = client.upload_click_conversions request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::UploadClickConversionsResponse. + # p result + # + def upload_click_conversions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::UploadClickConversionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.upload_click_conversions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.upload_click_conversions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_click_conversions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversion_upload_service_stub.call_rpc :upload_click_conversions, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Processes the given call conversions. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [PartialFailureError]() + # [QuotaError]() + # [RequestError]() + # + # @overload upload_call_conversions(request, options = nil) + # Pass arguments to `upload_call_conversions` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::UploadCallConversionsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::UploadCallConversionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upload_call_conversions(customer_id: nil, conversions: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `upload_call_conversions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer performing the upload. + # @param conversions [::Array<::Google::Ads::GoogleAds::V16::Services::CallConversion, ::Hash>] + # Required. The conversions that are being uploaded. + # @param partial_failure [::Boolean] + # Required. If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # This should always be set to true. + # See + # https://developers.google.com/google-ads/api/docs/best-practices/partial-failures + # for more information about partial failure. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::UploadCallConversionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::UploadCallConversionsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::UploadCallConversionsRequest.new + # + # # Call the upload_call_conversions method. + # result = client.upload_call_conversions request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::UploadCallConversionsResponse. + # p result + # + def upload_call_conversions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::UploadCallConversionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.upload_call_conversions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.upload_call_conversions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_call_conversions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversion_upload_service_stub.call_rpc :upload_call_conversions, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ConversionUploadService API. + # + # This class represents the configuration for ConversionUploadService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # upload_click_conversions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.upload_click_conversions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionUploadService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.upload_click_conversions.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ConversionUploadService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `upload_click_conversions` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_click_conversions + ## + # RPC-specific configuration for `upload_call_conversions` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_call_conversions + + # @private + def initialize parent_rpcs = nil + upload_click_conversions_config = parent_rpcs.upload_click_conversions if parent_rpcs.respond_to? :upload_click_conversions + @upload_click_conversions = ::Gapic::Config::Method.new upload_click_conversions_config + upload_call_conversions_config = parent_rpcs.upload_call_conversions if parent_rpcs.respond_to? :upload_call_conversions + @upload_call_conversions = ::Gapic::Config::Method.new upload_call_conversions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_upload_service/credentials.rb b/lib/google/ads/google_ads/v16/services/conversion_upload_service/credentials.rb new file mode 100644 index 000000000..faf379853 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_upload_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionUploadService + # Credentials for the ConversionUploadService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_upload_service/paths.rb b/lib/google/ads/google_ads/v16/services/conversion_upload_service/paths.rb new file mode 100644 index 000000000..eda429f3a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_upload_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionUploadService + # Path helper methods for the ConversionUploadService API. + module Paths + ## + # Create a fully-qualified ConversionCustomVariable resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionCustomVariables/{conversion_custom_variable_id}` + # + # @param customer_id [String] + # @param conversion_custom_variable_id [String] + # + # @return [::String] + def conversion_custom_variable_path customer_id:, conversion_custom_variable_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionCustomVariables/#{conversion_custom_variable_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_upload_service_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_upload_service_pb.rb new file mode 100644 index 000000000..dc2336f0c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_upload_service_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/conversion_upload_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/consent_pb' +require 'google/ads/google_ads/v16/common/offline_user_data_pb' +require 'google/ads/google_ads/v16/enums/conversion_environment_enum_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/services/conversion_upload_service.proto\x12!google.ads.googleads.v16.services\x1a-google/ads/googleads/v16/common/consent.proto\x1a\x37google/ads/googleads/v16/common/offline_user_data.proto\x1a@google/ads/googleads/v16/enums/conversion_environment_enum.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xf8\x01\n\x1dUploadClickConversionsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\x0b\x63onversions\x18\x02 \x03(\x0b\x32\x32.google.ads.googleads.v16.services.ClickConversionB\x03\xe0\x41\x02\x12\x1c\n\x0fpartial_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12\x15\n\rdebug_enabled\x18\x05 \x01(\x08\x12\x18\n\x06job_id\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\t\n\x07_job_id\"\xae\x01\n\x1eUploadClickConversionsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12I\n\x07results\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.ClickConversionResult\x12\x0e\n\x06job_id\x18\x03 \x01(\x03\"\xba\x01\n\x1cUploadCallConversionsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0b\x63onversions\x18\x02 \x03(\x0b\x32\x31.google.ads.googleads.v16.services.CallConversionB\x03\xe0\x41\x02\x12\x1c\n\x0fpartial_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x9c\x01\n\x1dUploadCallConversionsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12H\n\x07results\x18\x02 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.CallConversionResult\"\xaa\x06\n\x0f\x43lickConversion\x12\x12\n\x05gclid\x18\t \x01(\tH\x00\x88\x01\x01\x12\x0e\n\x06gbraid\x18\x12 \x01(\t\x12\x0e\n\x06wbraid\x18\x13 \x01(\t\x12\x1e\n\x11\x63onversion_action\x18\n \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x63onversion_date_time\x18\x0b \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10\x63onversion_value\x18\x0c \x01(\x01H\x03\x88\x01\x01\x12\x1a\n\rcurrency_code\x18\r \x01(\tH\x04\x88\x01\x01\x12\x15\n\x08order_id\x18\x0e \x01(\tH\x05\x88\x01\x01\x12]\n\x19\x65xternal_attribution_data\x18\x07 \x01(\x0b\x32:.google.ads.googleads.v16.services.ExternalAttributionData\x12K\n\x10\x63ustom_variables\x18\x0f \x03(\x0b\x32\x31.google.ads.googleads.v16.services.CustomVariable\x12>\n\tcart_data\x18\x10 \x01(\x0b\x32+.google.ads.googleads.v16.services.CartData\x12I\n\x10user_identifiers\x18\x11 \x03(\x0b\x32/.google.ads.googleads.v16.common.UserIdentifier\x12o\n\x16\x63onversion_environment\x18\x14 \x01(\x0e\x32O.google.ads.googleads.v16.enums.ConversionEnvironmentEnum.ConversionEnvironment\x12\x39\n\x07\x63onsent\x18\x17 \x01(\x0b\x32(.google.ads.googleads.v16.common.ConsentB\x08\n\x06_gclidB\x14\n\x12_conversion_actionB\x17\n\x15_conversion_date_timeB\x13\n\x11_conversion_valueB\x10\n\x0e_currency_codeB\x0b\n\t_order_id\"\xce\x03\n\x0e\x43\x61llConversion\x12\x16\n\tcaller_id\x18\x07 \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63\x61ll_start_date_time\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x1e\n\x11\x63onversion_action\x18\t \x01(\tH\x02\x88\x01\x01\x12!\n\x14\x63onversion_date_time\x18\n \x01(\tH\x03\x88\x01\x01\x12\x1d\n\x10\x63onversion_value\x18\x0b \x01(\x01H\x04\x88\x01\x01\x12\x1a\n\rcurrency_code\x18\x0c \x01(\tH\x05\x88\x01\x01\x12K\n\x10\x63ustom_variables\x18\r \x03(\x0b\x32\x31.google.ads.googleads.v16.services.CustomVariable\x12\x39\n\x07\x63onsent\x18\x0e \x01(\x0b\x32(.google.ads.googleads.v16.common.ConsentB\x0c\n\n_caller_idB\x17\n\x15_call_start_date_timeB\x14\n\x12_conversion_actionB\x17\n\x15_conversion_date_timeB\x13\n\x11_conversion_valueB\x10\n\x0e_currency_code\"\xab\x01\n\x17\x45xternalAttributionData\x12(\n\x1b\x65xternal_attribution_credit\x18\x03 \x01(\x01H\x00\x88\x01\x01\x12\'\n\x1a\x65xternal_attribution_model\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x1e\n\x1c_external_attribution_creditB\x1d\n\x1b_external_attribution_model\"\x92\x02\n\x15\x43lickConversionResult\x12\x12\n\x05gclid\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x0e\n\x06gbraid\x18\x08 \x01(\t\x12\x0e\n\x06wbraid\x18\t \x01(\t\x12\x1e\n\x11\x63onversion_action\x18\x05 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x63onversion_date_time\x18\x06 \x01(\tH\x02\x88\x01\x01\x12I\n\x10user_identifiers\x18\x07 \x03(\x0b\x32/.google.ads.googleads.v16.common.UserIdentifierB\x08\n\x06_gclidB\x14\n\x12_conversion_actionB\x17\n\x15_conversion_date_time\"\xea\x01\n\x14\x43\x61llConversionResult\x12\x16\n\tcaller_id\x18\x05 \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63\x61ll_start_date_time\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\x1e\n\x11\x63onversion_action\x18\x07 \x01(\tH\x02\x88\x01\x01\x12!\n\x14\x63onversion_date_time\x18\x08 \x01(\tH\x03\x88\x01\x01\x42\x0c\n\n_caller_idB\x17\n\x15_call_start_date_timeB\x14\n\x12_conversion_actionB\x17\n\x15_conversion_date_time\"{\n\x0e\x43ustomVariable\x12Z\n\x1a\x63onversion_custom_variable\x18\x01 \x01(\tB6\xfa\x41\x33\n1googleads.googleapis.com/ConversionCustomVariable\x12\r\n\x05value\x18\x02 \x01(\t\"\xf9\x01\n\x08\x43\x61rtData\x12\x13\n\x0bmerchant_id\x18\x06 \x01(\x03\x12\x19\n\x11\x66\x65\x65\x64_country_code\x18\x02 \x01(\t\x12\x1a\n\x12\x66\x65\x65\x64_language_code\x18\x03 \x01(\t\x12\x1e\n\x16local_transaction_cost\x18\x04 \x01(\x01\x12?\n\x05items\x18\x05 \x03(\x0b\x32\x30.google.ads.googleads.v16.services.CartData.Item\x1a@\n\x04Item\x12\x12\n\nproduct_id\x18\x01 \x01(\t\x12\x10\n\x08quantity\x18\x02 \x01(\x05\x12\x12\n\nunit_price\x18\x03 \x01(\x01\x32\xf4\x04\n\x17\x43onversionUploadService\x12\x89\x02\n\x16UploadClickConversions\x12@.google.ads.googleads.v16.services.UploadClickConversionsRequest\x1a\x41.google.ads.googleads.v16.services.UploadClickConversionsResponse\"j\xda\x41\'customer_id,conversions,partial_failure\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}:uploadClickConversions:\x01*\x12\x85\x02\n\x15UploadCallConversions\x12?.google.ads.googleads.v16.services.UploadCallConversionsRequest\x1a@.google.ads.googleads.v16.services.UploadCallConversionsResponse\"i\xda\x41\'customer_id,conversions,partial_failure\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}:uploadCallConversions:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x88\x02\n%com.google.ads.googleads.v16.servicesB\x1c\x43onversionUploadServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.ads.googleads.v16.common.UserIdentifier", "google/ads/googleads/v16/common/offline_user_data.proto"], + ["google.ads.googleads.v16.common.Consent", "google/ads/googleads/v16/common/consent.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + UploadClickConversionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UploadClickConversionsRequest").msgclass + UploadClickConversionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UploadClickConversionsResponse").msgclass + UploadCallConversionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UploadCallConversionsRequest").msgclass + UploadCallConversionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UploadCallConversionsResponse").msgclass + ClickConversion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ClickConversion").msgclass + CallConversion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CallConversion").msgclass + ExternalAttributionData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ExternalAttributionData").msgclass + ClickConversionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ClickConversionResult").msgclass + CallConversionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CallConversionResult").msgclass + CustomVariable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomVariable").msgclass + CartData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CartData").msgclass + CartData::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CartData.Item").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_upload_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_upload_service_services_pb.rb new file mode 100644 index 000000000..97a71b856 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_upload_service_services_pb.rb @@ -0,0 +1,68 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/conversion_upload_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/conversion_upload_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionUploadService + # Service to upload conversions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ConversionUploadService' + + # Processes the given click conversions. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ConversionUploadError]() + # [HeaderError]() + # [InternalError]() + # [PartialFailureError]() + # [QuotaError]() + # [RequestError]() + rpc :UploadClickConversions, ::Google::Ads::GoogleAds::V16::Services::UploadClickConversionsRequest, ::Google::Ads::GoogleAds::V16::Services::UploadClickConversionsResponse + # Processes the given call conversions. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [PartialFailureError]() + # [QuotaError]() + # [RequestError]() + rpc :UploadCallConversions, ::Google::Ads::GoogleAds::V16::Services::UploadCallConversionsRequest, ::Google::Ads::GoogleAds::V16::Services::UploadCallConversionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_service.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service.rb new file mode 100644 index 000000000..98d92de90 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/conversion_value_rule_service/credentials" +require "google/ads/google_ads/v16/services/conversion_value_rule_service/paths" +require "google/ads/google_ads/v16/services/conversion_value_rule_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage conversion value rules. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/conversion_value_rule_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client.new + # + module ConversionValueRuleService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversion_value_rule_service", "helpers.rb" +require "google/ads/google_ads/v16/services/conversion_value_rule_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/client.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/client.rb new file mode 100644 index 000000000..17c9bc80a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/conversion_value_rule_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionValueRuleService + ## + # Client for the ConversionValueRuleService service. + # + # Service to manage conversion value rules. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversion_value_rule_service_stub + + ## + # Configure the ConversionValueRuleService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversionValueRuleService clients + # ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversionValueRuleService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @conversion_value_rule_service_stub.universe_domain + end + + ## + # Create a new ConversionValueRuleService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversionValueRuleService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/conversion_value_rule_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @conversion_value_rule_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes conversion value rules. Operation statuses are + # returned. + # + # @overload mutate_conversion_value_rules(request, options = nil) + # Pass arguments to `mutate_conversion_value_rules` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_conversion_value_rules(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_conversion_value_rules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose conversion value rules are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleOperation, ::Hash>] + # Required. The list of operations to perform on individual conversion value + # rules. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesRequest.new + # + # # Call the mutate_conversion_value_rules method. + # result = client.mutate_conversion_value_rules request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesResponse. + # p result + # + def mutate_conversion_value_rules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_conversion_value_rules.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_conversion_value_rules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_conversion_value_rules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversion_value_rule_service_stub.call_rpc :mutate_conversion_value_rules, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ConversionValueRuleService API. + # + # This class represents the configuration for ConversionValueRuleService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_conversion_value_rules to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_value_rules.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_value_rules.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ConversionValueRuleService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_conversion_value_rules` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_conversion_value_rules + + # @private + def initialize parent_rpcs = nil + mutate_conversion_value_rules_config = parent_rpcs.mutate_conversion_value_rules if parent_rpcs.respond_to? :mutate_conversion_value_rules + @mutate_conversion_value_rules = ::Gapic::Config::Method.new mutate_conversion_value_rules_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/credentials.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/credentials.rb new file mode 100644 index 000000000..34fad5434 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionValueRuleService + # Credentials for the ConversionValueRuleService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/paths.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/paths.rb new file mode 100644 index 000000000..a8f63c4db --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service/paths.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionValueRuleService + # Path helper methods for the ConversionValueRuleService API. + module Paths + ## + # Create a fully-qualified ConversionValueRule resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionValueRules/{conversion_value_rule_id}` + # + # @param customer_id [String] + # @param conversion_value_rule_id [String] + # + # @return [::String] + def conversion_value_rule_path customer_id:, conversion_value_rule_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionValueRules/#{conversion_value_rule_id}" + end + + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified GeoTargetConstant resource string. + # + # The resource will be in the following format: + # + # `geoTargetConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def geo_target_constant_path criterion_id: + "geoTargetConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified UserInterest resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userInterests/{user_interest_id}` + # + # @param customer_id [String] + # @param user_interest_id [String] + # + # @return [::String] + def user_interest_path customer_id:, user_interest_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/userInterests/#{user_interest_id}" + end + + ## + # Create a fully-qualified UserList resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userLists/{user_list_id}` + # + # @param customer_id [String] + # @param user_list_id [String] + # + # @return [::String] + def user_list_path customer_id:, user_list_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/userLists/#{user_list_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_service_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service_pb.rb new file mode 100644 index 000000000..0c5eb03b2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/conversion_value_rule_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/conversion_value_rule_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/services/conversion_value_rule_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a>google/ads/googleads/v16/resources/conversion_value_rule.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb3\x02\n!MutateConversionValueRulesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12X\n\noperations\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.services.ConversionValueRuleOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x05 \x01(\x08\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12j\n\x15response_content_type\x18\x04 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xb7\x02\n\x1c\x43onversionValueRuleOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12I\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.ConversionValueRuleH\x00\x12I\n\x06update\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.ConversionValueRuleH\x00\x12\x43\n\x06remove\x18\x03 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/ConversionValueRuleH\x00\x42\x0b\n\toperation\"\xac\x01\n\"MutateConversionValueRulesResponse\x12S\n\x07results\x18\x02 \x03(\x0b\x32\x42.google.ads.googleads.v16.services.MutateConversionValueRuleResult\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\xc3\x01\n\x1fMutateConversionValueRuleResult\x12H\n\rresource_name\x18\x01 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/ConversionValueRule\x12V\n\x15\x63onversion_value_rule\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.ConversionValueRule2\xef\x02\n\x1a\x43onversionValueRuleService\x12\x89\x02\n\x1aMutateConversionValueRules\x12\x44.google.ads.googleads.v16.services.MutateConversionValueRulesRequest\x1a\x45.google.ads.googleads.v16.services.MutateConversionValueRulesResponse\"^\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02?\":/v16/customers/{customer_id=*}/conversionValueRules:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8b\x02\n%com.google.ads.googleads.v16.servicesB\x1f\x43onversionValueRuleServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.ConversionValueRule", "google/ads/googleads/v16/resources/conversion_value_rule.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateConversionValueRulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionValueRulesRequest").msgclass + ConversionValueRuleOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConversionValueRuleOperation").msgclass + MutateConversionValueRulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionValueRulesResponse").msgclass + MutateConversionValueRuleResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionValueRuleResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service_services_pb.rb new file mode 100644 index 000000000..99f32f771 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/conversion_value_rule_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/conversion_value_rule_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionValueRuleService + # Proto file describing the Conversion Value Rule service. + # + # Service to manage conversion value rules. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ConversionValueRuleService' + + # Creates, updates, or removes conversion value rules. Operation statuses are + # returned. + rpc :MutateConversionValueRules, ::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesRequest, ::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRulesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service.rb new file mode 100644 index 000000000..3b82b1a21 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/conversion_value_rule_set_service/credentials" +require "google/ads/google_ads/v16/services/conversion_value_rule_set_service/paths" +require "google/ads/google_ads/v16/services/conversion_value_rule_set_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage conversion value rule sets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/conversion_value_rule_set_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client.new + # + module ConversionValueRuleSetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversion_value_rule_set_service", "helpers.rb" +require "google/ads/google_ads/v16/services/conversion_value_rule_set_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/client.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/client.rb new file mode 100644 index 000000000..c714840af --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/conversion_value_rule_set_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionValueRuleSetService + ## + # Client for the ConversionValueRuleSetService service. + # + # Service to manage conversion value rule sets. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversion_value_rule_set_service_stub + + ## + # Configure the ConversionValueRuleSetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversionValueRuleSetService clients + # ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversionValueRuleSetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @conversion_value_rule_set_service_stub.universe_domain + end + + ## + # Create a new ConversionValueRuleSetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversionValueRuleSetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/conversion_value_rule_set_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @conversion_value_rule_set_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes conversion value rule sets. Operation statuses + # are returned. + # + # @overload mutate_conversion_value_rule_sets(request, options = nil) + # Pass arguments to `mutate_conversion_value_rule_sets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_conversion_value_rule_sets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_conversion_value_rule_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose conversion value rule sets are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetOperation, ::Hash>] + # Required. The list of operations to perform on individual conversion value + # rule sets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsRequest.new + # + # # Call the mutate_conversion_value_rule_sets method. + # result = client.mutate_conversion_value_rule_sets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsResponse. + # p result + # + def mutate_conversion_value_rule_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_conversion_value_rule_sets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_conversion_value_rule_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_conversion_value_rule_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversion_value_rule_set_service_stub.call_rpc :mutate_conversion_value_rule_sets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ConversionValueRuleSetService API. + # + # This class represents the configuration for ConversionValueRuleSetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_conversion_value_rule_sets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_value_rule_sets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ConversionValueRuleSetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_conversion_value_rule_sets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ConversionValueRuleSetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_conversion_value_rule_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_conversion_value_rule_sets + + # @private + def initialize parent_rpcs = nil + mutate_conversion_value_rule_sets_config = parent_rpcs.mutate_conversion_value_rule_sets if parent_rpcs.respond_to? :mutate_conversion_value_rule_sets + @mutate_conversion_value_rule_sets = ::Gapic::Config::Method.new mutate_conversion_value_rule_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/credentials.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/credentials.rb new file mode 100644 index 000000000..f73fb309c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionValueRuleSetService + # Credentials for the ConversionValueRuleSetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/paths.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/paths.rb new file mode 100644 index 000000000..f70fe70e3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service/paths.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionValueRuleSetService + # Path helper methods for the ConversionValueRuleSetService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified ConversionValueRule resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionValueRules/{conversion_value_rule_id}` + # + # @param customer_id [String] + # @param conversion_value_rule_id [String] + # + # @return [::String] + def conversion_value_rule_path customer_id:, conversion_value_rule_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionValueRules/#{conversion_value_rule_id}" + end + + ## + # Create a fully-qualified ConversionValueRuleSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionValueRuleSets/{conversion_value_rule_set_id}` + # + # @param customer_id [String] + # @param conversion_value_rule_set_id [String] + # + # @return [::String] + def conversion_value_rule_set_path customer_id:, conversion_value_rule_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionValueRuleSets/#{conversion_value_rule_set_id}" + end + + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service_pb.rb new file mode 100644 index 000000000..c94af5152 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/conversion_value_rule_set_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/conversion_value_rule_set_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nIgoogle/ads/googleads/v16/services/conversion_value_rule_set_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x42google/ads/googleads/v16/resources/conversion_value_rule_set.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb9\x02\n$MutateConversionValueRuleSetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12[\n\noperations\x18\x02 \x03(\x0b\x32\x42.google.ads.googleads.v16.services.ConversionValueRuleSetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x05 \x01(\x08\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12j\n\x15response_content_type\x18\x04 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xc3\x02\n\x1f\x43onversionValueRuleSetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12L\n\x06\x63reate\x18\x01 \x01(\x0b\x32:.google.ads.googleads.v16.resources.ConversionValueRuleSetH\x00\x12L\n\x06update\x18\x02 \x01(\x0b\x32:.google.ads.googleads.v16.resources.ConversionValueRuleSetH\x00\x12\x46\n\x06remove\x18\x03 \x01(\tB4\xfa\x41\x31\n/googleads.googleapis.com/ConversionValueRuleSetH\x00\x42\x0b\n\toperation\"\xb2\x01\n%MutateConversionValueRuleSetsResponse\x12V\n\x07results\x18\x01 \x03(\x0b\x32\x45.google.ads.googleads.v16.services.MutateConversionValueRuleSetResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xd0\x01\n\"MutateConversionValueRuleSetResult\x12K\n\rresource_name\x18\x01 \x01(\tB4\xfa\x41\x31\n/googleads.googleapis.com/ConversionValueRuleSet\x12]\n\x19\x63onversion_value_rule_set\x18\x02 \x01(\x0b\x32:.google.ads.googleads.v16.resources.ConversionValueRuleSet2\xfe\x02\n\x1d\x43onversionValueRuleSetService\x12\x95\x02\n\x1dMutateConversionValueRuleSets\x12G.google.ads.googleads.v16.services.MutateConversionValueRuleSetsRequest\x1aH.google.ads.googleads.v16.services.MutateConversionValueRuleSetsResponse\"a\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x42\"=/v16/customers/{customer_id=*}/conversionValueRuleSets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8e\x02\n%com.google.ads.googleads.v16.servicesB\"ConversionValueRuleSetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.ConversionValueRuleSet", "google/ads/googleads/v16/resources/conversion_value_rule_set.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateConversionValueRuleSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionValueRuleSetsRequest").msgclass + ConversionValueRuleSetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConversionValueRuleSetOperation").msgclass + MutateConversionValueRuleSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionValueRuleSetsResponse").msgclass + MutateConversionValueRuleSetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateConversionValueRuleSetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service_services_pb.rb new file mode 100644 index 000000000..00549d54f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/conversion_value_rule_set_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/conversion_value_rule_set_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/conversion_value_rule_set_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ConversionValueRuleSetService + # Proto file describing the Conversion Value Rule Set service. + # + # Service to manage conversion value rule sets. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ConversionValueRuleSetService' + + # Creates, updates or removes conversion value rule sets. Operation statuses + # are returned. + rpc :MutateConversionValueRuleSets, ::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateConversionValueRuleSetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_audience_service.rb b/lib/google/ads/google_ads/v16/services/custom_audience_service.rb new file mode 100644 index 000000000..7d978027b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_audience_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/custom_audience_service/credentials" +require "google/ads/google_ads/v16/services/custom_audience_service/paths" +require "google/ads/google_ads/v16/services/custom_audience_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage custom audiences. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/custom_audience_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client.new + # + module CustomAudienceService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "custom_audience_service", "helpers.rb" +require "google/ads/google_ads/v16/services/custom_audience_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/custom_audience_service/client.rb b/lib/google/ads/google_ads/v16/services/custom_audience_service/client.rb new file mode 100644 index 000000000..00515424f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_audience_service/client.rb @@ -0,0 +1,444 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/custom_audience_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomAudienceService + ## + # Client for the CustomAudienceService service. + # + # Service to manage custom audiences. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :custom_audience_service_stub + + ## + # Configure the CustomAudienceService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomAudienceService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomAudienceService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @custom_audience_service_stub.universe_domain + end + + ## + # Create a new CustomAudienceService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomAudienceService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/custom_audience_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @custom_audience_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or updates custom audiences. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CustomAudienceError]() + # [CustomInterestError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [OperationAccessDeniedError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_custom_audiences(request, options = nil) + # Pass arguments to `mutate_custom_audiences` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_custom_audiences(customer_id: nil, operations: nil, validate_only: nil) + # Pass arguments to `mutate_custom_audiences` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose custom audiences are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomAudienceOperation, ::Hash>] + # Required. The list of operations to perform on individual custom audiences. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesRequest.new + # + # # Call the mutate_custom_audiences method. + # result = client.mutate_custom_audiences request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesResponse. + # p result + # + def mutate_custom_audiences request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_custom_audiences.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_custom_audiences.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_custom_audiences.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @custom_audience_service_stub.call_rpc :mutate_custom_audiences, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomAudienceService API. + # + # This class represents the configuration for CustomAudienceService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_custom_audiences to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_custom_audiences.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomAudienceService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_custom_audiences.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomAudienceService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_custom_audiences` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_custom_audiences + + # @private + def initialize parent_rpcs = nil + mutate_custom_audiences_config = parent_rpcs.mutate_custom_audiences if parent_rpcs.respond_to? :mutate_custom_audiences + @mutate_custom_audiences = ::Gapic::Config::Method.new mutate_custom_audiences_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_audience_service/credentials.rb b/lib/google/ads/google_ads/v16/services/custom_audience_service/credentials.rb new file mode 100644 index 000000000..d76000012 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_audience_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomAudienceService + # Credentials for the CustomAudienceService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_audience_service/paths.rb b/lib/google/ads/google_ads/v16/services/custom_audience_service/paths.rb new file mode 100644 index 000000000..72a7b0b62 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_audience_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomAudienceService + # Path helper methods for the CustomAudienceService API. + module Paths + ## + # Create a fully-qualified CustomAudience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customAudiences/{custom_audience_id}` + # + # @param customer_id [String] + # @param custom_audience_id [String] + # + # @return [::String] + def custom_audience_path customer_id:, custom_audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customAudiences/#{custom_audience_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_audience_service_pb.rb b/lib/google/ads/google_ads/v16/services/custom_audience_service_pb.rb new file mode 100644 index 000000000..0b1013dbc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_audience_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/custom_audience_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/custom_audience_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/services/custom_audience_service.proto\x12!google.ads.googleads.v16.services\x1a\x38google/ads/googleads/v16/resources/custom_audience.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xa4\x01\n\x1cMutateCustomAudiencesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12S\n\noperations\x18\x02 \x03(\x0b\x32:.google.ads.googleads.v16.services.CustomAudienceOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa3\x02\n\x17\x43ustomAudienceOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x44\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CustomAudienceH\x00\x12\x44\n\x06update\x18\x02 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CustomAudienceH\x00\x12>\n\x06remove\x18\x03 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/CustomAudienceH\x00\x42\x0b\n\toperation\"o\n\x1dMutateCustomAudiencesResponse\x12N\n\x07results\x18\x01 \x03(\x0b\x32=.google.ads.googleads.v16.services.MutateCustomAudienceResult\"a\n\x1aMutateCustomAudienceResult\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/CustomAudience2\xd6\x02\n\x15\x43ustomAudienceService\x12\xf5\x01\n\x15MutateCustomAudiences\x12?.google.ads.googleads.v16.services.MutateCustomAudiencesRequest\x1a@.google.ads.googleads.v16.services.MutateCustomAudiencesResponse\"Y\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}/customAudiences:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x86\x02\n%com.google.ads.googleads.v16.servicesB\x1a\x43ustomAudienceServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomAudience", "google/ads/googleads/v16/resources/custom_audience.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomAudiencesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomAudiencesRequest").msgclass + CustomAudienceOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomAudienceOperation").msgclass + MutateCustomAudiencesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomAudiencesResponse").msgclass + MutateCustomAudienceResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomAudienceResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_audience_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/custom_audience_service_services_pb.rb new file mode 100644 index 000000000..6e6436a0f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_audience_service_services_pb.rb @@ -0,0 +1,64 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/custom_audience_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/custom_audience_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomAudienceService + # Proto file describing the Custom Audience service. + # + # Service to manage custom audiences. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomAudienceService' + + # Creates or updates custom audiences. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CustomAudienceError]() + # [CustomInterestError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [OperationAccessDeniedError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCustomAudiences, ::Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomAudiencesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service.rb b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service.rb new file mode 100644 index 000000000..2a6ad0501 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/custom_conversion_goal_service/credentials" +require "google/ads/google_ads/v16/services/custom_conversion_goal_service/paths" +require "google/ads/google_ads/v16/services/custom_conversion_goal_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage custom conversion goal. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/custom_conversion_goal_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client.new + # + module CustomConversionGoalService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "custom_conversion_goal_service", "helpers.rb" +require "google/ads/google_ads/v16/services/custom_conversion_goal_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/client.rb b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/client.rb new file mode 100644 index 000000000..c0976e4ce --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/client.rb @@ -0,0 +1,435 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/custom_conversion_goal_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomConversionGoalService + ## + # Client for the CustomConversionGoalService service. + # + # Service to manage custom conversion goal. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :custom_conversion_goal_service_stub + + ## + # Configure the CustomConversionGoalService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomConversionGoalService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomConversionGoalService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @custom_conversion_goal_service_stub.universe_domain + end + + ## + # Create a new CustomConversionGoalService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomConversionGoalService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/custom_conversion_goal_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @custom_conversion_goal_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes custom conversion goals. Operation statuses + # are returned. + # + # @overload mutate_custom_conversion_goals(request, options = nil) + # Pass arguments to `mutate_custom_conversion_goals` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_custom_conversion_goals(customer_id: nil, operations: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_custom_conversion_goals` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose custom conversion goals are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalOperation, ::Hash>] + # Required. The list of operations to perform on individual custom conversion + # goal. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsRequest.new + # + # # Call the mutate_custom_conversion_goals method. + # result = client.mutate_custom_conversion_goals request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsResponse. + # p result + # + def mutate_custom_conversion_goals request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_custom_conversion_goals.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_custom_conversion_goals.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_custom_conversion_goals.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @custom_conversion_goal_service_stub.call_rpc :mutate_custom_conversion_goals, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomConversionGoalService API. + # + # This class represents the configuration for CustomConversionGoalService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_custom_conversion_goals to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_custom_conversion_goals.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomConversionGoalService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_custom_conversion_goals.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomConversionGoalService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_custom_conversion_goals` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_custom_conversion_goals + + # @private + def initialize parent_rpcs = nil + mutate_custom_conversion_goals_config = parent_rpcs.mutate_custom_conversion_goals if parent_rpcs.respond_to? :mutate_custom_conversion_goals + @mutate_custom_conversion_goals = ::Gapic::Config::Method.new mutate_custom_conversion_goals_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/credentials.rb b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/credentials.rb new file mode 100644 index 000000000..242793127 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomConversionGoalService + # Credentials for the CustomConversionGoalService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/paths.rb b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/paths.rb new file mode 100644 index 000000000..fc662170e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomConversionGoalService + # Path helper methods for the CustomConversionGoalService API. + module Paths + ## + # Create a fully-qualified ConversionAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionActions/{conversion_action_id}` + # + # @param customer_id [String] + # @param conversion_action_id [String] + # + # @return [::String] + def conversion_action_path customer_id:, conversion_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionActions/#{conversion_action_id}" + end + + ## + # Create a fully-qualified CustomConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customConversionGoals/{goal_id}` + # + # @param customer_id [String] + # @param goal_id [String] + # + # @return [::String] + def custom_conversion_goal_path customer_id:, goal_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customConversionGoals/#{goal_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service_pb.rb b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service_pb.rb new file mode 100644 index 000000000..6a2fd41e6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/custom_conversion_goal_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/custom_conversion_goal_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/services/custom_conversion_goal_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a?google/ads/googleads/v16/resources/custom_conversion_goal.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\x9c\x02\n\"MutateCustomConversionGoalsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Y\n\noperations\x18\x02 \x03(\x0b\x32@.google.ads.googleads.v16.services.CustomConversionGoalOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12j\n\x15response_content_type\x18\x04 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xbb\x02\n\x1d\x43ustomConversionGoalOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12J\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.CustomConversionGoalH\x00\x12J\n\x06update\x18\x02 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.CustomConversionGoalH\x00\x12\x44\n\x06remove\x18\x03 \x01(\tB2\xfa\x41/\n-googleads.googleapis.com/CustomConversionGoalH\x00\x42\x0b\n\toperation\"{\n#MutateCustomConversionGoalsResponse\x12T\n\x07results\x18\x01 \x03(\x0b\x32\x43.google.ads.googleads.v16.services.MutateCustomConversionGoalResult\"\xc7\x01\n MutateCustomConversionGoalResult\x12I\n\rresource_name\x18\x01 \x01(\tB2\xfa\x41/\n-googleads.googleapis.com/CustomConversionGoal\x12X\n\x16\x63ustom_conversion_goal\x18\x02 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.CustomConversionGoal2\xf4\x02\n\x1b\x43ustomConversionGoalService\x12\x8d\x02\n\x1bMutateCustomConversionGoals\x12\x45.google.ads.googleads.v16.services.MutateCustomConversionGoalsRequest\x1a\x46.google.ads.googleads.v16.services.MutateCustomConversionGoalsResponse\"_\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02@\";/v16/customers/{customer_id=*}/customConversionGoals:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8c\x02\n%com.google.ads.googleads.v16.servicesB CustomConversionGoalServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomConversionGoal", "google/ads/googleads/v16/resources/custom_conversion_goal.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomConversionGoalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomConversionGoalsRequest").msgclass + CustomConversionGoalOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomConversionGoalOperation").msgclass + MutateCustomConversionGoalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomConversionGoalsResponse").msgclass + MutateCustomConversionGoalResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomConversionGoalResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service_services_pb.rb new file mode 100644 index 000000000..c2c8244ce --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_conversion_goal_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/custom_conversion_goal_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/custom_conversion_goal_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomConversionGoalService + # Proto file describing the CustomConversionGoal service. + # + # Service to manage custom conversion goal. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomConversionGoalService' + + # Creates, updates or removes custom conversion goals. Operation statuses + # are returned. + rpc :MutateCustomConversionGoals, ::Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomConversionGoalsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_interest_service.rb b/lib/google/ads/google_ads/v16/services/custom_interest_service.rb new file mode 100644 index 000000000..54a74a059 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_interest_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/custom_interest_service/credentials" +require "google/ads/google_ads/v16/services/custom_interest_service/paths" +require "google/ads/google_ads/v16/services/custom_interest_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage custom interests. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/custom_interest_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client.new + # + module CustomInterestService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "custom_interest_service", "helpers.rb" +require "google/ads/google_ads/v16/services/custom_interest_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/custom_interest_service/client.rb b/lib/google/ads/google_ads/v16/services/custom_interest_service/client.rb new file mode 100644 index 000000000..6539c0d37 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_interest_service/client.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/custom_interest_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomInterestService + ## + # Client for the CustomInterestService service. + # + # Service to manage custom interests. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :custom_interest_service_stub + + ## + # Configure the CustomInterestService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomInterestService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomInterestService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @custom_interest_service_stub.universe_domain + end + + ## + # Create a new CustomInterestService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomInterestService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/custom_interest_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @custom_interest_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or updates custom interests. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CriterionError]() + # [CustomInterestError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RequestError]() + # [StringLengthError]() + # + # @overload mutate_custom_interests(request, options = nil) + # Pass arguments to `mutate_custom_interests` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_custom_interests(customer_id: nil, operations: nil, validate_only: nil) + # Pass arguments to `mutate_custom_interests` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose custom interests are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomInterestOperation, ::Hash>] + # Required. The list of operations to perform on individual custom interests. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsRequest.new + # + # # Call the mutate_custom_interests method. + # result = client.mutate_custom_interests request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsResponse. + # p result + # + def mutate_custom_interests request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_custom_interests.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_custom_interests.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_custom_interests.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @custom_interest_service_stub.call_rpc :mutate_custom_interests, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomInterestService API. + # + # This class represents the configuration for CustomInterestService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_custom_interests to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_custom_interests.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomInterestService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_custom_interests.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomInterestService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_custom_interests` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_custom_interests + + # @private + def initialize parent_rpcs = nil + mutate_custom_interests_config = parent_rpcs.mutate_custom_interests if parent_rpcs.respond_to? :mutate_custom_interests + @mutate_custom_interests = ::Gapic::Config::Method.new mutate_custom_interests_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_interest_service/credentials.rb b/lib/google/ads/google_ads/v16/services/custom_interest_service/credentials.rb new file mode 100644 index 000000000..61fd65fae --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_interest_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomInterestService + # Credentials for the CustomInterestService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_interest_service/paths.rb b/lib/google/ads/google_ads/v16/services/custom_interest_service/paths.rb new file mode 100644 index 000000000..607f12521 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_interest_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomInterestService + # Path helper methods for the CustomInterestService API. + module Paths + ## + # Create a fully-qualified CustomInterest resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customInterests/{custom_interest_id}` + # + # @param customer_id [String] + # @param custom_interest_id [String] + # + # @return [::String] + def custom_interest_path customer_id:, custom_interest_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customInterests/#{custom_interest_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_interest_service_pb.rb b/lib/google/ads/google_ads/v16/services/custom_interest_service_pb.rb new file mode 100644 index 000000000..40341ec03 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_interest_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/custom_interest_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/custom_interest_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n?google/ads/googleads/v16/services/custom_interest_service.proto\x12!google.ads.googleads.v16.services\x1a\x38google/ads/googleads/v16/resources/custom_interest.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xa4\x01\n\x1cMutateCustomInterestsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12S\n\noperations\x18\x02 \x03(\x0b\x32:.google.ads.googleads.v16.services.CustomInterestOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xe3\x01\n\x17\x43ustomInterestOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x44\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CustomInterestH\x00\x12\x44\n\x06update\x18\x02 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CustomInterestH\x00\x42\x0b\n\toperation\"o\n\x1dMutateCustomInterestsResponse\x12N\n\x07results\x18\x02 \x03(\x0b\x32=.google.ads.googleads.v16.services.MutateCustomInterestResult\"a\n\x1aMutateCustomInterestResult\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/CustomInterest2\xd6\x02\n\x15\x43ustomInterestService\x12\xf5\x01\n\x15MutateCustomInterests\x12?.google.ads.googleads.v16.services.MutateCustomInterestsRequest\x1a@.google.ads.googleads.v16.services.MutateCustomInterestsResponse\"Y\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}/customInterests:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x86\x02\n%com.google.ads.googleads.v16.servicesB\x1a\x43ustomInterestServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomInterest", "google/ads/googleads/v16/resources/custom_interest.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomInterestsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomInterestsRequest").msgclass + CustomInterestOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomInterestOperation").msgclass + MutateCustomInterestsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomInterestsResponse").msgclass + MutateCustomInterestResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomInterestResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/custom_interest_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/custom_interest_service_services_pb.rb new file mode 100644 index 000000000..e3093326d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/custom_interest_service_services_pb.rb @@ -0,0 +1,62 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/custom_interest_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/custom_interest_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomInterestService + # Proto file describing the Custom Interest service. + # + # Service to manage custom interests. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomInterestService' + + # Creates or updates custom interests. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CriterionError]() + # [CustomInterestError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RequestError]() + # [StringLengthError]() + rpc :MutateCustomInterests, ::Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomInterestsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_service.rb b/lib/google/ads/google_ads/v16/services/customer_asset_service.rb new file mode 100644 index 000000000..7e2c0f147 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_asset_service/credentials" +require "google/ads/google_ads/v16/services/customer_asset_service/paths" +require "google/ads/google_ads/v16/services/customer_asset_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer assets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_asset_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client.new + # + module CustomerAssetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_asset_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_asset_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_asset_service/client.rb new file mode 100644 index 000000000..0ddb8c061 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_service/client.rb @@ -0,0 +1,449 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_asset_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerAssetService + ## + # Client for the CustomerAssetService service. + # + # Service to manage customer assets. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_asset_service_stub + + ## + # Configure the CustomerAssetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerAssetService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerAssetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_asset_service_stub.universe_domain + end + + ## + # Create a new CustomerAssetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerAssetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_asset_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_asset_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes customer assets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_customer_assets(request, options = nil) + # Pass arguments to `mutate_customer_assets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_assets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_customer_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customer assets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerAssetOperation, ::Hash>] + # Required. The list of operations to perform on individual customer assets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsRequest.new + # + # # Call the mutate_customer_assets method. + # result = client.mutate_customer_assets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsResponse. + # p result + # + def mutate_customer_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_assets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_asset_service_stub.call_rpc :mutate_customer_assets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerAssetService API. + # + # This class represents the configuration for CustomerAssetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_assets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_assets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerAssetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_assets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerAssetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_assets + + # @private + def initialize parent_rpcs = nil + mutate_customer_assets_config = parent_rpcs.mutate_customer_assets if parent_rpcs.respond_to? :mutate_customer_assets + @mutate_customer_assets = ::Gapic::Config::Method.new mutate_customer_assets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_asset_service/credentials.rb new file mode 100644 index 000000000..fc5513220 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerAssetService + # Credentials for the CustomerAssetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_asset_service/paths.rb new file mode 100644 index 000000000..6af266ba6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerAssetService + # Path helper methods for the CustomerAssetService API. + module Paths + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified CustomerAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerAssets/{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def customer_asset_path customer_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/customerAssets/#{asset_id}~#{field_type}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_asset_service_pb.rb new file mode 100644 index 000000000..1b1fa8f79 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_asset_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/customer_asset_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/customer_asset_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x37google/ads/googleads/v16/resources/customer_asset.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa7\x02\n\x1bMutateCustomerAssetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\noperations\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.CustomerAssetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x9f\x02\n\x16\x43ustomerAssetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CustomerAssetH\x00\x12\x43\n\x06update\x18\x03 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CustomerAssetH\x00\x12=\n\x06remove\x18\x02 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CustomerAssetH\x00\x42\x0b\n\toperation\"\xa0\x01\n\x1cMutateCustomerAssetsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12M\n\x07results\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.MutateCustomerAssetResult\"\xaa\x01\n\x19MutateCustomerAssetResult\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CustomerAsset\x12I\n\x0e\x63ustomer_asset\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CustomerAsset2\xd1\x02\n\x14\x43ustomerAssetService\x12\xf1\x01\n\x14MutateCustomerAssets\x12>.google.ads.googleads.v16.services.MutateCustomerAssetsRequest\x1a?.google.ads.googleads.v16.services.MutateCustomerAssetsResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/customerAssets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x85\x02\n%com.google.ads.googleads.v16.servicesB\x19\x43ustomerAssetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomerAsset", "google/ads/googleads/v16/resources/customer_asset.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerAssetsRequest").msgclass + CustomerAssetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerAssetOperation").msgclass + MutateCustomerAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerAssetsResponse").msgclass + MutateCustomerAssetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerAssetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_asset_service_services_pb.rb new file mode 100644 index 000000000..4c68719d3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_asset_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_asset_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerAssetService + # Proto file describing the CustomerAsset service. + # + # Service to manage customer assets. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerAssetService' + + # Creates, updates, or removes customer assets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AssetLinkError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCustomerAssets, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_set_service.rb b/lib/google/ads/google_ads/v16/services/customer_asset_set_service.rb new file mode 100644 index 000000000..e2f10ecfd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_set_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_asset_set_service/credentials" +require "google/ads/google_ads/v16/services/customer_asset_set_service/paths" +require "google/ads/google_ads/v16/services/customer_asset_set_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer asset set + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_asset_set_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client.new + # + module CustomerAssetSetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_asset_set_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_asset_set_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_set_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_asset_set_service/client.rb new file mode 100644 index 000000000..7a6119c83 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_set_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_asset_set_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerAssetSetService + ## + # Client for the CustomerAssetSetService service. + # + # Service to manage customer asset set + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_asset_set_service_stub + + ## + # Configure the CustomerAssetSetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerAssetSetService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerAssetSetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_asset_set_service_stub.universe_domain + end + + ## + # Create a new CustomerAssetSetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerAssetSetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_asset_set_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_asset_set_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, or removes customer asset sets. Operation statuses are + # returned. + # + # @overload mutate_customer_asset_sets(request, options = nil) + # Pass arguments to `mutate_customer_asset_sets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_asset_sets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_customer_asset_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customer asset sets are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetOperation, ::Hash>] + # Required. The list of operations to perform on individual customer asset + # sets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsRequest.new + # + # # Call the mutate_customer_asset_sets method. + # result = client.mutate_customer_asset_sets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsResponse. + # p result + # + def mutate_customer_asset_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_asset_sets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_asset_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_asset_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_asset_set_service_stub.call_rpc :mutate_customer_asset_sets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerAssetSetService API. + # + # This class represents the configuration for CustomerAssetSetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_asset_sets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_asset_sets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerAssetSetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_asset_sets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerAssetSetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_asset_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_asset_sets + + # @private + def initialize parent_rpcs = nil + mutate_customer_asset_sets_config = parent_rpcs.mutate_customer_asset_sets if parent_rpcs.respond_to? :mutate_customer_asset_sets + @mutate_customer_asset_sets = ::Gapic::Config::Method.new mutate_customer_asset_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_set_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_asset_set_service/credentials.rb new file mode 100644 index 000000000..62b5029f9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_set_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerAssetSetService + # Credentials for the CustomerAssetSetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_set_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_asset_set_service/paths.rb new file mode 100644 index 000000000..b685ce539 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_set_service/paths.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerAssetSetService + # Path helper methods for the CustomerAssetSetService API. + module Paths + ## + # Create a fully-qualified AssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSets/#{asset_set_id}" + end + + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified CustomerAssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerAssetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def customer_asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerAssetSets/#{asset_set_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_set_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_asset_set_service_pb.rb new file mode 100644 index 000000000..2c1413874 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_set_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_asset_set_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/customer_asset_set_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/services/customer_asset_set_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a;google/ads/googleads/v16/resources/customer_asset_set.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xad\x02\n\x1eMutateCustomerAssetSetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12U\n\noperations\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.CustomerAssetSetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xb2\x01\n\x19\x43ustomerAssetSetOperation\x12\x46\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CustomerAssetSetH\x00\x12@\n\x06remove\x18\x02 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/CustomerAssetSetH\x00\x42\x0b\n\toperation\"\xa6\x01\n\x1fMutateCustomerAssetSetsResponse\x12P\n\x07results\x18\x01 \x03(\x0b\x32?.google.ads.googleads.v16.services.MutateCustomerAssetSetResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xb7\x01\n\x1cMutateCustomerAssetSetResult\x12\x45\n\rresource_name\x18\x01 \x01(\tB.\xfa\x41+\n)googleads.googleapis.com/CustomerAssetSet\x12P\n\x12\x63ustomer_asset_set\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CustomerAssetSet2\xe0\x02\n\x17\x43ustomerAssetSetService\x12\xfd\x01\n\x17MutateCustomerAssetSets\x12\x41.google.ads.googleads.v16.services.MutateCustomerAssetSetsRequest\x1a\x42.google.ads.googleads.v16.services.MutateCustomerAssetSetsResponse\"[\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02<\"7/v16/customers/{customer_id=*}/customerAssetSets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x88\x02\n%com.google.ads.googleads.v16.servicesB\x1c\x43ustomerAssetSetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CustomerAssetSet", "google/ads/googleads/v16/resources/customer_asset_set.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerAssetSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerAssetSetsRequest").msgclass + CustomerAssetSetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerAssetSetOperation").msgclass + MutateCustomerAssetSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerAssetSetsResponse").msgclass + MutateCustomerAssetSetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerAssetSetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_asset_set_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_asset_set_service_services_pb.rb new file mode 100644 index 000000000..1c74942de --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_asset_set_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_asset_set_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_asset_set_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerAssetSetService + # Proto file describing the CustomerAssetSet service. + # + # Service to manage customer asset set + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerAssetSetService' + + # Creates, or removes customer asset sets. Operation statuses are + # returned. + rpc :MutateCustomerAssetSets, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerAssetSetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_client_link_service.rb b/lib/google/ads/google_ads/v16/services/customer_client_link_service.rb new file mode 100644 index 000000000..8064875aa --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_client_link_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_client_link_service/credentials" +require "google/ads/google_ads/v16/services/customer_client_link_service/paths" +require "google/ads/google_ads/v16/services/customer_client_link_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer client links. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_client_link_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client.new + # + module CustomerClientLinkService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_client_link_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_client_link_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_client_link_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_client_link_service/client.rb new file mode 100644 index 000000000..920ddd4fc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_client_link_service/client.rb @@ -0,0 +1,443 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_client_link_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerClientLinkService + ## + # Client for the CustomerClientLinkService service. + # + # Service to manage customer client links. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_client_link_service_stub + + ## + # Configure the CustomerClientLinkService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerClientLinkService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerClientLinkService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_client_link_service_stub.universe_domain + end + + ## + # Create a new CustomerClientLinkService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerClientLinkService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_client_link_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_client_link_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or updates a customer client link. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [ManagerLinkError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_customer_client_link(request, options = nil) + # Pass arguments to `mutate_customer_client_link` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_client_link(customer_id: nil, operation: nil, validate_only: nil) + # Pass arguments to `mutate_customer_client_link` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customer link are being modified. + # @param operation [::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkOperation, ::Hash] + # Required. The operation to perform on the individual CustomerClientLink. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkRequest.new + # + # # Call the mutate_customer_client_link method. + # result = client.mutate_customer_client_link request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkResponse. + # p result + # + def mutate_customer_client_link request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_client_link.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_client_link.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_client_link.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_client_link_service_stub.call_rpc :mutate_customer_client_link, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerClientLinkService API. + # + # This class represents the configuration for CustomerClientLinkService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_client_link to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_client_link.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerClientLinkService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_client_link.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerClientLinkService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_client_link` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_client_link + + # @private + def initialize parent_rpcs = nil + mutate_customer_client_link_config = parent_rpcs.mutate_customer_client_link if parent_rpcs.respond_to? :mutate_customer_client_link + @mutate_customer_client_link = ::Gapic::Config::Method.new mutate_customer_client_link_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_client_link_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_client_link_service/credentials.rb new file mode 100644 index 000000000..21563ff18 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_client_link_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerClientLinkService + # Credentials for the CustomerClientLinkService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_client_link_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_client_link_service/paths.rb new file mode 100644 index 000000000..891e33e5d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_client_link_service/paths.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerClientLinkService + # Path helper methods for the CustomerClientLinkService API. + module Paths + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified CustomerClientLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerClientLinks/{client_customer_id}~{manager_link_id}` + # + # @param customer_id [String] + # @param client_customer_id [String] + # @param manager_link_id [String] + # + # @return [::String] + def customer_client_link_path customer_id:, client_customer_id:, manager_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "client_customer_id cannot contain /" if client_customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerClientLinks/#{client_customer_id}~#{manager_link_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_client_link_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_client_link_service_pb.rb new file mode 100644 index 000000000..721a820f9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_client_link_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_client_link_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/customer_client_link_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/services/customer_client_link_service.proto\x12!google.ads.googleads.v16.services\x1a=google/ads/googleads/v16/resources/customer_client_link.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xaa\x01\n\x1fMutateCustomerClientLinkRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12V\n\toperation\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.services.CustomerClientLinkOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xef\x01\n\x1b\x43ustomerClientLinkOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12H\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CustomerClientLinkH\x00\x12H\n\x06update\x18\x02 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CustomerClientLinkH\x00\x42\x0b\n\toperation\"u\n MutateCustomerClientLinkResponse\x12Q\n\x06result\x18\x01 \x01(\x0b\x32\x41.google.ads.googleads.v16.services.MutateCustomerClientLinkResult\"i\n\x1eMutateCustomerClientLinkResult\x12G\n\rresource_name\x18\x01 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/CustomerClientLink2\xe6\x02\n\x19\x43ustomerClientLinkService\x12\x81\x02\n\x18MutateCustomerClientLink\x12\x42.google.ads.googleads.v16.services.MutateCustomerClientLinkRequest\x1a\x43.google.ads.googleads.v16.services.MutateCustomerClientLinkResponse\"\\\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02>\"9/v16/customers/{customer_id=*}/customerClientLinks:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8a\x02\n%com.google.ads.googleads.v16.servicesB\x1e\x43ustomerClientLinkServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomerClientLink", "google/ads/googleads/v16/resources/customer_client_link.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerClientLinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerClientLinkRequest").msgclass + CustomerClientLinkOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerClientLinkOperation").msgclass + MutateCustomerClientLinkResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerClientLinkResponse").msgclass + MutateCustomerClientLinkResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerClientLinkResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_client_link_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_client_link_service_services_pb.rb new file mode 100644 index 000000000..67a10941d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_client_link_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_client_link_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_client_link_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerClientLinkService + # Service to manage customer client links. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerClientLinkService' + + # Creates or updates a customer client link. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [ManagerLinkError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCustomerClientLink, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerClientLinkResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service.rb b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service.rb new file mode 100644 index 000000000..e1373681a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_conversion_goal_service/credentials" +require "google/ads/google_ads/v16/services/customer_conversion_goal_service/paths" +require "google/ads/google_ads/v16/services/customer_conversion_goal_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer conversion goal. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_conversion_goal_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client.new + # + module CustomerConversionGoalService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_conversion_goal_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_conversion_goal_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/client.rb new file mode 100644 index 000000000..4b7f49145 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/client.rb @@ -0,0 +1,432 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_conversion_goal_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerConversionGoalService + ## + # Client for the CustomerConversionGoalService service. + # + # Service to manage customer conversion goal. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_conversion_goal_service_stub + + ## + # Configure the CustomerConversionGoalService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerConversionGoalService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerConversionGoalService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_conversion_goal_service_stub.universe_domain + end + + ## + # Create a new CustomerConversionGoalService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerConversionGoalService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_conversion_goal_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_conversion_goal_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes customer conversion goals. Operation statuses + # are returned. + # + # @overload mutate_customer_conversion_goals(request, options = nil) + # Pass arguments to `mutate_customer_conversion_goals` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_conversion_goals(customer_id: nil, operations: nil, validate_only: nil) + # Pass arguments to `mutate_customer_conversion_goals` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customer conversion goals are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalOperation, ::Hash>] + # Required. The list of operations to perform on individual customer + # conversion goal. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsRequest.new + # + # # Call the mutate_customer_conversion_goals method. + # result = client.mutate_customer_conversion_goals request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsResponse. + # p result + # + def mutate_customer_conversion_goals request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_conversion_goals.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_conversion_goals.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_conversion_goals.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_conversion_goal_service_stub.call_rpc :mutate_customer_conversion_goals, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerConversionGoalService API. + # + # This class represents the configuration for CustomerConversionGoalService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_conversion_goals to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_conversion_goals.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerConversionGoalService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_conversion_goals.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerConversionGoalService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_conversion_goals` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_conversion_goals + + # @private + def initialize parent_rpcs = nil + mutate_customer_conversion_goals_config = parent_rpcs.mutate_customer_conversion_goals if parent_rpcs.respond_to? :mutate_customer_conversion_goals + @mutate_customer_conversion_goals = ::Gapic::Config::Method.new mutate_customer_conversion_goals_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/credentials.rb new file mode 100644 index 000000000..51884a15e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerConversionGoalService + # Credentials for the CustomerConversionGoalService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/paths.rb new file mode 100644 index 000000000..85bd94a18 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service/paths.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerConversionGoalService + # Path helper methods for the CustomerConversionGoalService API. + module Paths + ## + # Create a fully-qualified CustomerConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerConversionGoals/{category}~{source}` + # + # @param customer_id [String] + # @param category [String] + # @param source [String] + # + # @return [::String] + def customer_conversion_goal_path customer_id:, category:, source: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "category cannot contain /" if category.to_s.include? "/" + + "customers/#{customer_id}/customerConversionGoals/#{category}~#{source}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service_pb.rb new file mode 100644 index 000000000..7c8bc0e85 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_conversion_goal_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/customer_conversion_goal_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nHgoogle/ads/googleads/v16/services/customer_conversion_goal_service.proto\x12!google.ads.googleads.v16.services\x1a\x41google/ads/googleads/v16/resources/customer_conversion_goal.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xb4\x01\n$MutateCustomerConversionGoalsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12[\n\noperations\x18\x02 \x03(\x0b\x32\x42.google.ads.googleads.v16.services.CustomerConversionGoalOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xad\x01\n\x1f\x43ustomerConversionGoalOperation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12L\n\x06update\x18\x01 \x01(\x0b\x32:.google.ads.googleads.v16.resources.CustomerConversionGoalH\x00\x42\x0b\n\toperation\"\x7f\n%MutateCustomerConversionGoalsResponse\x12V\n\x07results\x18\x01 \x03(\x0b\x32\x45.google.ads.googleads.v16.services.MutateCustomerConversionGoalResult\"q\n\"MutateCustomerConversionGoalResult\x12K\n\rresource_name\x18\x01 \x01(\tB4\xfa\x41\x31\n/googleads.googleapis.com/CustomerConversionGoal2\xfe\x02\n\x1d\x43ustomerConversionGoalService\x12\x95\x02\n\x1dMutateCustomerConversionGoals\x12G.google.ads.googleads.v16.services.MutateCustomerConversionGoalsRequest\x1aH.google.ads.googleads.v16.services.MutateCustomerConversionGoalsResponse\"a\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x42\"=/v16/customers/{customer_id=*}/customerConversionGoals:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8e\x02\n%com.google.ads.googleads.v16.servicesB\"CustomerConversionGoalServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomerConversionGoal", "google/ads/googleads/v16/resources/customer_conversion_goal.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerConversionGoalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerConversionGoalsRequest").msgclass + CustomerConversionGoalOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerConversionGoalOperation").msgclass + MutateCustomerConversionGoalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerConversionGoalsResponse").msgclass + MutateCustomerConversionGoalResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerConversionGoalResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service_services_pb.rb new file mode 100644 index 000000000..28e1dcccc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_conversion_goal_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_conversion_goal_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_conversion_goal_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerConversionGoalService + # Proto file describing the CustomerConversionGoal service. + # + # Service to manage customer conversion goal. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerConversionGoalService' + + # Creates, updates or removes customer conversion goals. Operation statuses + # are returned. + rpc :MutateCustomerConversionGoals, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerConversionGoalsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_customizer_service.rb b/lib/google/ads/google_ads/v16/services/customer_customizer_service.rb new file mode 100644 index 000000000..e9272d4e4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_customizer_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_customizer_service/credentials" +require "google/ads/google_ads/v16/services/customer_customizer_service/paths" +require "google/ads/google_ads/v16/services/customer_customizer_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer customizer + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_customizer_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client.new + # + module CustomerCustomizerService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_customizer_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_customizer_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_customizer_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_customizer_service/client.rb new file mode 100644 index 000000000..894ee43e4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_customizer_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_customizer_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerCustomizerService + ## + # Client for the CustomerCustomizerService service. + # + # Service to manage customer customizer + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_customizer_service_stub + + ## + # Configure the CustomerCustomizerService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerCustomizerService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerCustomizerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_customizer_service_stub.universe_domain + end + + ## + # Create a new CustomerCustomizerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerCustomizerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_customizer_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_customizer_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes customer customizers. Operation statuses are + # returned. + # + # @overload mutate_customer_customizers(request, options = nil) + # Pass arguments to `mutate_customer_customizers` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_customizers(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_customer_customizers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customer customizers are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerOperation, ::Hash>] + # Required. The list of operations to perform on individual customer + # customizers. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersRequest.new + # + # # Call the mutate_customer_customizers method. + # result = client.mutate_customer_customizers request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersResponse. + # p result + # + def mutate_customer_customizers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_customizers.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_customizers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_customizers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_customizer_service_stub.call_rpc :mutate_customer_customizers, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerCustomizerService API. + # + # This class represents the configuration for CustomerCustomizerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_customizers to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_customizers.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerCustomizerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_customizers.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerCustomizerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_customizers` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_customizers + + # @private + def initialize parent_rpcs = nil + mutate_customer_customizers_config = parent_rpcs.mutate_customer_customizers if parent_rpcs.respond_to? :mutate_customer_customizers + @mutate_customer_customizers = ::Gapic::Config::Method.new mutate_customer_customizers_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_customizer_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_customizer_service/credentials.rb new file mode 100644 index 000000000..a5740a166 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_customizer_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerCustomizerService + # Credentials for the CustomerCustomizerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_customizer_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_customizer_service/paths.rb new file mode 100644 index 000000000..ea20ddc97 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_customizer_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerCustomizerService + # Path helper methods for the CustomerCustomizerService API. + module Paths + ## + # Create a fully-qualified CustomerCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerCustomizers/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customer_customizer_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerCustomizers/#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified CustomizerAttribute resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customizerAttributes/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customizer_attribute_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customizerAttributes/#{customizer_attribute_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_customizer_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_customizer_service_pb.rb new file mode 100644 index 000000000..513757f00 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_customizer_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_customizer_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/customer_customizer_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/services/customer_customizer_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a.google.ads.googleads.v16.services.CustomerCustomizerOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xb8\x01\n\x1b\x43ustomerCustomizerOperation\x12H\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CustomerCustomizerH\x00\x12\x42\n\x06remove\x18\x02 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/CustomerCustomizerH\x00\x42\x0b\n\toperation\"\xaa\x01\n!MutateCustomerCustomizersResponse\x12R\n\x07results\x18\x01 \x03(\x0b\x32\x41.google.ads.googleads.v16.services.MutateCustomerCustomizerResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xbe\x01\n\x1eMutateCustomerCustomizerResult\x12G\n\rresource_name\x18\x01 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/CustomerCustomizer\x12S\n\x13\x63ustomer_customizer\x18\x02 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CustomerCustomizer2\xea\x02\n\x19\x43ustomerCustomizerService\x12\x85\x02\n\x19MutateCustomerCustomizers\x12\x43.google.ads.googleads.v16.services.MutateCustomerCustomizersRequest\x1a\x44.google.ads.googleads.v16.services.MutateCustomerCustomizersResponse\"]\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02>\"9/v16/customers/{customer_id=*}/CustomerCustomizers:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8a\x02\n%com.google.ads.googleads.v16.servicesB\x1e\x43ustomerCustomizerServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CustomerCustomizer", "google/ads/googleads/v16/resources/customer_customizer.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerCustomizersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerCustomizersRequest").msgclass + CustomerCustomizerOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerCustomizerOperation").msgclass + MutateCustomerCustomizersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerCustomizersResponse").msgclass + MutateCustomerCustomizerResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerCustomizerResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_customizer_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_customizer_service_services_pb.rb new file mode 100644 index 000000000..c0a82b39d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_customizer_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_customizer_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_customizer_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerCustomizerService + # Proto file describing the CustomerCustomizer service. + # + # Service to manage customer customizer + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerCustomizerService' + + # Creates, updates or removes customer customizers. Operation statuses are + # returned. + rpc :MutateCustomerCustomizers, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerCustomizersResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_extension_setting_service.rb b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service.rb new file mode 100644 index 000000000..d1455f96a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_extension_setting_service/credentials" +require "google/ads/google_ads/v16/services/customer_extension_setting_service/paths" +require "google/ads/google_ads/v16/services/customer_extension_setting_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer extension settings. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_extension_setting_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client.new + # + module CustomerExtensionSettingService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_extension_setting_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_extension_setting_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/client.rb new file mode 100644 index 000000000..2c84492f3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/client.rb @@ -0,0 +1,467 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_extension_setting_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerExtensionSettingService + ## + # Client for the CustomerExtensionSettingService service. + # + # Service to manage customer extension settings. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_extension_setting_service_stub + + ## + # Configure the CustomerExtensionSettingService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerExtensionSettingService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerExtensionSettingService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_extension_setting_service_stub.universe_domain + end + + ## + # Create a new CustomerExtensionSettingService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerExtensionSettingService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_extension_setting_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_extension_setting_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes customer extension settings. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [ExtensionSettingError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # + # @overload mutate_customer_extension_settings(request, options = nil) + # Pass arguments to `mutate_customer_extension_settings` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_extension_settings(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_customer_extension_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customer extension settings are + # being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingOperation, ::Hash>] + # Required. The list of operations to perform on individual customer + # extension settings. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsRequest.new + # + # # Call the mutate_customer_extension_settings method. + # result = client.mutate_customer_extension_settings request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsResponse. + # p result + # + def mutate_customer_extension_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_extension_settings.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_extension_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_extension_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_extension_setting_service_stub.call_rpc :mutate_customer_extension_settings, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerExtensionSettingService API. + # + # This class represents the configuration for CustomerExtensionSettingService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_extension_settings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_extension_settings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerExtensionSettingService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_extension_settings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerExtensionSettingService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_extension_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_extension_settings + + # @private + def initialize parent_rpcs = nil + mutate_customer_extension_settings_config = parent_rpcs.mutate_customer_extension_settings if parent_rpcs.respond_to? :mutate_customer_extension_settings + @mutate_customer_extension_settings = ::Gapic::Config::Method.new mutate_customer_extension_settings_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/credentials.rb new file mode 100644 index 000000000..f9e60b1a7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerExtensionSettingService + # Credentials for the CustomerExtensionSettingService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/paths.rb new file mode 100644 index 000000000..0ce7258dd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerExtensionSettingService + # Path helper methods for the CustomerExtensionSettingService API. + module Paths + ## + # Create a fully-qualified CustomerExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerExtensionSettings/{extension_type}` + # + # @param customer_id [String] + # @param extension_type [String] + # + # @return [::String] + def customer_extension_setting_path customer_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerExtensionSettings/#{extension_type}" + end + + ## + # Create a fully-qualified ExtensionFeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/extensionFeedItems/{feed_item_id}` + # + # @param customer_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def extension_feed_item_path customer_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/extensionFeedItems/#{feed_item_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_extension_setting_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service_pb.rb new file mode 100644 index 000000000..68fbef97a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_extension_setting_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/customer_extension_setting_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nJgoogle/ads/googleads/v16/services/customer_extension_setting_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x43google/ads/googleads/v16/resources/customer_extension_setting.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xbd\x02\n&MutateCustomerExtensionSettingsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12]\n\noperations\x18\x02 \x03(\x0b\x32\x44.google.ads.googleads.v16.services.CustomerExtensionSettingOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xcb\x02\n!CustomerExtensionSettingOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12N\n\x06\x63reate\x18\x01 \x01(\x0b\x32<.google.ads.googleads.v16.resources.CustomerExtensionSettingH\x00\x12N\n\x06update\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.resources.CustomerExtensionSettingH\x00\x12H\n\x06remove\x18\x03 \x01(\tB6\xfa\x41\x33\n1googleads.googleapis.com/CustomerExtensionSettingH\x00\x42\x0b\n\toperation\"\xb6\x01\n\'MutateCustomerExtensionSettingsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12X\n\x07results\x18\x02 \x03(\x0b\x32G.google.ads.googleads.v16.services.MutateCustomerExtensionSettingResult\"\xd7\x01\n$MutateCustomerExtensionSettingResult\x12M\n\rresource_name\x18\x01 \x01(\tB6\xfa\x41\x33\n1googleads.googleapis.com/CustomerExtensionSetting\x12`\n\x1a\x63ustomer_extension_setting\x18\x02 \x01(\x0b\x32<.google.ads.googleads.v16.resources.CustomerExtensionSetting2\x88\x03\n\x1f\x43ustomerExtensionSettingService\x12\x9d\x02\n\x1fMutateCustomerExtensionSettings\x12I.google.ads.googleads.v16.services.MutateCustomerExtensionSettingsRequest\x1aJ.google.ads.googleads.v16.services.MutateCustomerExtensionSettingsResponse\"c\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x44\"?/v16/customers/{customer_id=*}/customerExtensionSettings:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x90\x02\n%com.google.ads.googleads.v16.servicesB$CustomerExtensionSettingServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomerExtensionSetting", "google/ads/googleads/v16/resources/customer_extension_setting.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerExtensionSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerExtensionSettingsRequest").msgclass + CustomerExtensionSettingOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerExtensionSettingOperation").msgclass + MutateCustomerExtensionSettingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerExtensionSettingsResponse").msgclass + MutateCustomerExtensionSettingResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerExtensionSettingResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_extension_setting_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service_services_pb.rb new file mode 100644 index 000000000..054294efd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_extension_setting_service_services_pb.rb @@ -0,0 +1,77 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_extension_setting_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_extension_setting_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerExtensionSettingService + # Proto file describing the CustomerExtensionSetting service. + # + # Service to manage customer extension settings. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerExtensionSettingService' + + # Creates, updates, or removes customer extension settings. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [ExtensionSettingError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateCustomerExtensionSettings, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerExtensionSettingsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_feed_service.rb b/lib/google/ads/google_ads/v16/services/customer_feed_service.rb new file mode 100644 index 000000000..0a731459d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_feed_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_feed_service/credentials" +require "google/ads/google_ads/v16/services/customer_feed_service/paths" +require "google/ads/google_ads/v16/services/customer_feed_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer feeds. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_feed_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client.new + # + module CustomerFeedService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_feed_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_feed_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_feed_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_feed_service/client.rb new file mode 100644 index 000000000..75e239452 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_feed_service/client.rb @@ -0,0 +1,462 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_feed_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerFeedService + ## + # Client for the CustomerFeedService service. + # + # Service to manage customer feeds. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_feed_service_stub + + ## + # Configure the CustomerFeedService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerFeedService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerFeedService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_feed_service_stub.universe_domain + end + + ## + # Create a new CustomerFeedService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerFeedService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_feed_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_feed_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes customer feeds. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CustomerFeedError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_customer_feeds(request, options = nil) + # Pass arguments to `mutate_customer_feeds` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_feeds(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_customer_feeds` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customer feeds are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerFeedOperation, ::Hash>] + # Required. The list of operations to perform on individual customer feeds. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsRequest.new + # + # # Call the mutate_customer_feeds method. + # result = client.mutate_customer_feeds request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsResponse. + # p result + # + def mutate_customer_feeds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_feeds.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_feeds.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_feeds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_feed_service_stub.call_rpc :mutate_customer_feeds, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerFeedService API. + # + # This class represents the configuration for CustomerFeedService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_feeds to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_feeds.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerFeedService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_feeds.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerFeedService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_feeds` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_feeds + + # @private + def initialize parent_rpcs = nil + mutate_customer_feeds_config = parent_rpcs.mutate_customer_feeds if parent_rpcs.respond_to? :mutate_customer_feeds + @mutate_customer_feeds = ::Gapic::Config::Method.new mutate_customer_feeds_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_feed_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_feed_service/credentials.rb new file mode 100644 index 000000000..f0e3ea2cb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_feed_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerFeedService + # Credentials for the CustomerFeedService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_feed_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_feed_service/paths.rb new file mode 100644 index 000000000..27b664244 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_feed_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerFeedService + # Path helper methods for the CustomerFeedService API. + module Paths + ## + # Create a fully-qualified CustomerFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerFeeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def customer_feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerFeeds/#{feed_id}" + end + + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_feed_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_feed_service_pb.rb new file mode 100644 index 000000000..71a4b380d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_feed_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_feed_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/customer_feed_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/services/customer_feed_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x36google/ads/googleads/v16/resources/customer_feed.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa5\x02\n\x1aMutateCustomerFeedsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Q\n\noperations\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.CustomerFeedOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x9b\x02\n\x15\x43ustomerFeedOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x42\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CustomerFeedH\x00\x12\x42\n\x06update\x18\x02 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CustomerFeedH\x00\x12<\n\x06remove\x18\x03 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/CustomerFeedH\x00\x42\x0b\n\toperation\"\x9e\x01\n\x1bMutateCustomerFeedsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12L\n\x07results\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.MutateCustomerFeedResult\"\xa6\x01\n\x18MutateCustomerFeedResult\x12\x41\n\rresource_name\x18\x01 \x01(\tB*\xfa\x41\'\n%googleads.googleapis.com/CustomerFeed\x12G\n\rcustomer_feed\x18\x02 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CustomerFeed2\xcc\x02\n\x13\x43ustomerFeedService\x12\xed\x01\n\x13MutateCustomerFeeds\x12=.google.ads.googleads.v16.services.MutateCustomerFeedsRequest\x1a>.google.ads.googleads.v16.services.MutateCustomerFeedsResponse\"W\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x38\"3/v16/customers/{customer_id=*}/customerFeeds:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x84\x02\n%com.google.ads.googleads.v16.servicesB\x18\x43ustomerFeedServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomerFeed", "google/ads/googleads/v16/resources/customer_feed.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerFeedsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerFeedsRequest").msgclass + CustomerFeedOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerFeedOperation").msgclass + MutateCustomerFeedsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerFeedsResponse").msgclass + MutateCustomerFeedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerFeedResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_feed_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_feed_service_services_pb.rb new file mode 100644 index 000000000..35bc11d8b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_feed_service_services_pb.rb @@ -0,0 +1,74 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_feed_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_feed_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerFeedService + # Proto file describing the CustomerFeed service. + # + # Service to manage customer feeds. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerFeedService' + + # Creates, updates, or removes customer feeds. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CustomerFeedError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionError]() + # [FunctionParsingError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateCustomerFeeds, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerFeedsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_label_service.rb b/lib/google/ads/google_ads/v16/services/customer_label_service.rb new file mode 100644 index 000000000..2abbc1ffc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_label_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_label_service/credentials" +require "google/ads/google_ads/v16/services/customer_label_service/paths" +require "google/ads/google_ads/v16/services/customer_label_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage labels on customers. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_label_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client.new + # + module CustomerLabelService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_label_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_label_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_label_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_label_service/client.rb new file mode 100644 index 000000000..ae7a47eb8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_label_service/client.rb @@ -0,0 +1,448 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_label_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerLabelService + ## + # Client for the CustomerLabelService service. + # + # Service to manage labels on customers. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_label_service_stub + + ## + # Configure the CustomerLabelService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerLabelService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerLabelService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_label_service_stub.universe_domain + end + + ## + # Create a new CustomerLabelService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerLabelService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_label_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_label_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates and removes customer-label relationships. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [HeaderError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_customer_labels(request, options = nil) + # Pass arguments to `mutate_customer_labels` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_labels(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_customer_labels` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. ID of the customer whose customer-label relationships are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerLabelOperation, ::Hash>] + # Required. The list of operations to perform on customer-label + # relationships. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsRequest.new + # + # # Call the mutate_customer_labels method. + # result = client.mutate_customer_labels request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsResponse. + # p result + # + def mutate_customer_labels request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_labels.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_labels.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_labels.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_label_service_stub.call_rpc :mutate_customer_labels, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerLabelService API. + # + # This class represents the configuration for CustomerLabelService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_labels to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_labels.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerLabelService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_labels.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerLabelService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_labels` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_labels + + # @private + def initialize parent_rpcs = nil + mutate_customer_labels_config = parent_rpcs.mutate_customer_labels if parent_rpcs.respond_to? :mutate_customer_labels + @mutate_customer_labels = ::Gapic::Config::Method.new mutate_customer_labels_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_label_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_label_service/credentials.rb new file mode 100644 index 000000000..c96f337ac --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_label_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerLabelService + # Credentials for the CustomerLabelService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_label_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_label_service/paths.rb new file mode 100644 index 000000000..2ad08cbd3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_label_service/paths.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerLabelService + # Path helper methods for the CustomerLabelService API. + module Paths + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified CustomerLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerLabels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def customer_label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerLabels/#{label_id}" + end + + ## + # Create a fully-qualified Label resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/labels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/labels/#{label_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_label_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_label_service_pb.rb new file mode 100644 index 000000000..aa5ed81aa --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_label_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_label_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/customer_label_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/customer_label_service.proto\x12!google.ads.googleads.v16.services\x1a\x37google/ads/googleads/v16/resources/customer_label.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xbb\x01\n\x1bMutateCustomerLabelsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\noperations\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.CustomerLabelOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xa9\x01\n\x16\x43ustomerLabelOperation\x12\x43\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CustomerLabelH\x00\x12=\n\x06remove\x18\x02 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CustomerLabelH\x00\x42\x0b\n\toperation\"\xa0\x01\n\x1cMutateCustomerLabelsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12M\n\x07results\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.MutateCustomerLabelResult\"_\n\x19MutateCustomerLabelResult\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/CustomerLabel2\xd1\x02\n\x14\x43ustomerLabelService\x12\xf1\x01\n\x14MutateCustomerLabels\x12>.google.ads.googleads.v16.services.MutateCustomerLabelsRequest\x1a?.google.ads.googleads.v16.services.MutateCustomerLabelsResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/customerLabels:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x85\x02\n%com.google.ads.googleads.v16.servicesB\x19\x43ustomerLabelServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CustomerLabel", "google/ads/googleads/v16/resources/customer_label.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerLabelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerLabelsRequest").msgclass + CustomerLabelOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerLabelOperation").msgclass + MutateCustomerLabelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerLabelsResponse").msgclass + MutateCustomerLabelResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerLabelResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_label_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_label_service_services_pb.rb new file mode 100644 index 000000000..14b28aaf7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_label_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_label_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_label_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerLabelService + # Proto file describing the Customer Label service. + # + # Service to manage labels on customers. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerLabelService' + + # Creates and removes customer-label relationships. + # Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [HeaderError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCustomerLabels, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerLabelsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service.rb b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service.rb new file mode 100644 index 000000000..839eb7f0a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_lifecycle_goal_service/credentials" +require "google/ads/google_ads/v16/services/customer_lifecycle_goal_service/paths" +require "google/ads/google_ads/v16/services/customer_lifecycle_goal_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to configure customer lifecycle goals. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_lifecycle_goal_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client.new + # + module CustomerLifecycleGoalService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_lifecycle_goal_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_lifecycle_goal_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/client.rb new file mode 100644 index 000000000..49c4c35b2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/client.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_lifecycle_goal_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerLifecycleGoalService + ## + # Client for the CustomerLifecycleGoalService service. + # + # Service to configure customer lifecycle goals. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_lifecycle_goal_service_stub + + ## + # Configure the CustomerLifecycleGoalService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerLifecycleGoalService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerLifecycleGoalService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_lifecycle_goal_service_stub.universe_domain + end + + ## + # Create a new CustomerLifecycleGoalService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerLifecycleGoalService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_lifecycle_goal_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_lifecycle_goal_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Process the given customer lifecycle configurations. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CustomerLifecycleGoalConfigError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload configure_customer_lifecycle_goals(request, options = nil) + # Pass arguments to `configure_customer_lifecycle_goals` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload configure_customer_lifecycle_goals(customer_id: nil, operation: nil, validate_only: nil) + # Pass arguments to `configure_customer_lifecycle_goals` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer performing the upload. + # @param operation [::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalOperation, ::Hash] + # Required. The operation to perform customer lifecycle goal update. + # @param validate_only [::Boolean] + # Optional. If true, the request is validated but not executed. Only errors + # are returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsRequest.new + # + # # Call the configure_customer_lifecycle_goals method. + # result = client.configure_customer_lifecycle_goals request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsResponse. + # p result + # + def configure_customer_lifecycle_goals request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.configure_customer_lifecycle_goals.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.configure_customer_lifecycle_goals.timeout, + metadata: metadata, + retry_policy: @config.rpcs.configure_customer_lifecycle_goals.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_lifecycle_goal_service_stub.call_rpc :configure_customer_lifecycle_goals, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerLifecycleGoalService API. + # + # This class represents the configuration for CustomerLifecycleGoalService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # configure_customer_lifecycle_goals to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.configure_customer_lifecycle_goals.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerLifecycleGoalService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.configure_customer_lifecycle_goals.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerLifecycleGoalService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `configure_customer_lifecycle_goals` + # @return [::Gapic::Config::Method] + # + attr_reader :configure_customer_lifecycle_goals + + # @private + def initialize parent_rpcs = nil + configure_customer_lifecycle_goals_config = parent_rpcs.configure_customer_lifecycle_goals if parent_rpcs.respond_to? :configure_customer_lifecycle_goals + @configure_customer_lifecycle_goals = ::Gapic::Config::Method.new configure_customer_lifecycle_goals_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/credentials.rb new file mode 100644 index 000000000..6a7d16a0f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerLifecycleGoalService + # Credentials for the CustomerLifecycleGoalService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/paths.rb new file mode 100644 index 000000000..64a81875f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerLifecycleGoalService + # Path helper methods for the CustomerLifecycleGoalService API. + module Paths + ## + # Create a fully-qualified CustomerLifecycleGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerLifecycleGoals` + # + # @param customer_id [String] + # + # @return [::String] + def customer_lifecycle_goal_path customer_id: + "customers/#{customer_id}/customerLifecycleGoals" + end + + ## + # Create a fully-qualified UserList resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userLists/{user_list_id}` + # + # @param customer_id [String] + # @param user_list_id [String] + # + # @return [::String] + def user_list_path customer_id:, user_list_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/userLists/#{user_list_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service_pb.rb new file mode 100644 index 000000000..39c344896 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_lifecycle_goal_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/customer_lifecycle_goal_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/services/customer_lifecycle_goal_service.proto\x12!google.ads.googleads.v16.services\x1a@google/ads/googleads/v16/resources/customer_lifecycle_goal.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xb9\x01\n&ConfigureCustomerLifecycleGoalsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Y\n\toperation\x18\x02 \x01(\x0b\x32\x41.google.ads.googleads.v16.services.CustomerLifecycleGoalOperationB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xfd\x01\n\x1e\x43ustomerLifecycleGoalOperation\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12K\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.CustomerLifecycleGoalH\x00\x12K\n\x06update\x18\x03 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.CustomerLifecycleGoalH\x00\x42\x0b\n\toperation\"\x83\x01\n\'ConfigureCustomerLifecycleGoalsResponse\x12X\n\x06result\x18\x01 \x01(\x0b\x32H.google.ads.googleads.v16.services.ConfigureCustomerLifecycleGoalsResult\"s\n%ConfigureCustomerLifecycleGoalsResult\x12J\n\rresource_name\x18\x01 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/CustomerLifecycleGoal2\x99\x03\n\x1c\x43ustomerLifecycleGoalService\x12\xb1\x02\n\x1f\x43onfigureCustomerLifecycleGoals\x12I.google.ads.googleads.v16.services.ConfigureCustomerLifecycleGoalsRequest\x1aJ.google.ads.googleads.v16.services.ConfigureCustomerLifecycleGoalsResponse\"w\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02Y\"T/v16/customers/{customer_id=*}/customerLifecycleGoal:configureCustomerLifecycleGoals:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8d\x02\n%com.google.ads.googleads.v16.servicesB!CustomerLifecycleGoalServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomerLifecycleGoal", "google/ads/googleads/v16/resources/customer_lifecycle_goal.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + ConfigureCustomerLifecycleGoalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConfigureCustomerLifecycleGoalsRequest").msgclass + CustomerLifecycleGoalOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerLifecycleGoalOperation").msgclass + ConfigureCustomerLifecycleGoalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConfigureCustomerLifecycleGoalsResponse").msgclass + ConfigureCustomerLifecycleGoalsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ConfigureCustomerLifecycleGoalsResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service_services_pb.rb new file mode 100644 index 000000000..9431fc000 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_lifecycle_goal_service_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_lifecycle_goal_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_lifecycle_goal_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerLifecycleGoalService + # Service to configure customer lifecycle goals. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerLifecycleGoalService' + + # Process the given customer lifecycle configurations. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CustomerLifecycleGoalConfigError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :ConfigureCustomerLifecycleGoals, ::Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsRequest, ::Google::Ads::GoogleAds::V16::Services::ConfigureCustomerLifecycleGoalsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_manager_link_service.rb b/lib/google/ads/google_ads/v16/services/customer_manager_link_service.rb new file mode 100644 index 000000000..9d828f309 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_manager_link_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_manager_link_service/credentials" +require "google/ads/google_ads/v16/services/customer_manager_link_service/paths" +require "google/ads/google_ads/v16/services/customer_manager_link_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer-manager links. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_manager_link_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client.new + # + module CustomerManagerLinkService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_manager_link_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_manager_link_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_manager_link_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_manager_link_service/client.rb new file mode 100644 index 000000000..e76474569 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_manager_link_service/client.rb @@ -0,0 +1,564 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_manager_link_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerManagerLinkService + ## + # Client for the CustomerManagerLinkService service. + # + # Service to manage customer-manager links. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_manager_link_service_stub + + ## + # Configure the CustomerManagerLinkService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerManagerLinkService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerManagerLinkService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_manager_link_service_stub.universe_domain + end + + ## + # Create a new CustomerManagerLinkService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerManagerLinkService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_manager_link_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_manager_link_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Updates customer manager links. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [ManagerLinkError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_customer_manager_link(request, options = nil) + # Pass arguments to `mutate_customer_manager_link` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_manager_link(customer_id: nil, operations: nil, validate_only: nil) + # Pass arguments to `mutate_customer_manager_link` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customer manager links are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkOperation, ::Hash>] + # Required. The list of operations to perform on individual customer manager + # links. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkRequest.new + # + # # Call the mutate_customer_manager_link method. + # result = client.mutate_customer_manager_link request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkResponse. + # p result + # + def mutate_customer_manager_link request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_manager_link.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_manager_link.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_manager_link.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_manager_link_service_stub.call_rpc :mutate_customer_manager_link, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Moves a client customer to a new manager customer. + # This simplifies the complex request that requires two operations to move + # a client customer to a new manager, for example: + # 1. Update operation with Status INACTIVE (previous manager) and, + # 2. Update operation with Status ACTIVE (new manager). + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload move_manager_link(request, options = nil) + # Pass arguments to `move_manager_link` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MoveManagerLinkRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MoveManagerLinkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload move_manager_link(customer_id: nil, previous_customer_manager_link: nil, new_manager: nil, validate_only: nil) + # Pass arguments to `move_manager_link` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the client customer that is being moved. + # @param previous_customer_manager_link [::String] + # Required. The resource name of the previous CustomerManagerLink. + # The resource name has the form: + # `customers/{customer_id}/customerManagerLinks/{manager_customer_id}~{manager_link_id}` + # @param new_manager [::String] + # Required. The resource name of the new manager customer that the client + # wants to move to. Customer resource names have the format: + # "customers/\\{customer_id}" + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MoveManagerLinkResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MoveManagerLinkResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MoveManagerLinkRequest.new + # + # # Call the move_manager_link method. + # result = client.move_manager_link request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MoveManagerLinkResponse. + # p result + # + def move_manager_link request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MoveManagerLinkRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.move_manager_link.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.move_manager_link.timeout, + metadata: metadata, + retry_policy: @config.rpcs.move_manager_link.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_manager_link_service_stub.call_rpc :move_manager_link, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerManagerLinkService API. + # + # This class represents the configuration for CustomerManagerLinkService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_manager_link to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_manager_link.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerManagerLinkService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_manager_link.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerManagerLinkService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_manager_link` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_manager_link + ## + # RPC-specific configuration for `move_manager_link` + # @return [::Gapic::Config::Method] + # + attr_reader :move_manager_link + + # @private + def initialize parent_rpcs = nil + mutate_customer_manager_link_config = parent_rpcs.mutate_customer_manager_link if parent_rpcs.respond_to? :mutate_customer_manager_link + @mutate_customer_manager_link = ::Gapic::Config::Method.new mutate_customer_manager_link_config + move_manager_link_config = parent_rpcs.move_manager_link if parent_rpcs.respond_to? :move_manager_link + @move_manager_link = ::Gapic::Config::Method.new move_manager_link_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_manager_link_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_manager_link_service/credentials.rb new file mode 100644 index 000000000..0a6e67259 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_manager_link_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerManagerLinkService + # Credentials for the CustomerManagerLinkService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_manager_link_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_manager_link_service/paths.rb new file mode 100644 index 000000000..961eeb2d9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_manager_link_service/paths.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerManagerLinkService + # Path helper methods for the CustomerManagerLinkService API. + module Paths + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified CustomerManagerLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerManagerLinks/{manager_customer_id}~{manager_link_id}` + # + # @param customer_id [String] + # @param manager_customer_id [String] + # @param manager_link_id [String] + # + # @return [::String] + def customer_manager_link_path customer_id:, manager_customer_id:, manager_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "manager_customer_id cannot contain /" if manager_customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerManagerLinks/#{manager_customer_id}~#{manager_link_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_manager_link_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_manager_link_service_pb.rb new file mode 100644 index 000000000..d23e515f4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_manager_link_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_manager_link_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/customer_manager_link_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/services/customer_manager_link_service.proto\x12!google.ads.googleads.v16.services\x1a>google/ads/googleads/v16/resources/customer_manager_link.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xad\x01\n MutateCustomerManagerLinkRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12X\n\noperations\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.services.CustomerManagerLinkOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x90\x01\n\x16MoveManagerLinkRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12+\n\x1eprevious_customer_manager_link\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bnew_manager\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xa7\x01\n\x1c\x43ustomerManagerLinkOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12I\n\x06update\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CustomerManagerLinkH\x00\x42\x0b\n\toperation\"x\n!MutateCustomerManagerLinkResponse\x12S\n\x07results\x18\x01 \x03(\x0b\x32\x42.google.ads.googleads.v16.services.MutateCustomerManagerLinkResult\"c\n\x17MoveManagerLinkResponse\x12H\n\rresource_name\x18\x01 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/CustomerManagerLink\"k\n\x1fMutateCustomerManagerLinkResult\x12H\n\rresource_name\x18\x01 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/CustomerManagerLink2\x81\x05\n\x1a\x43ustomerManagerLinkService\x12\x86\x02\n\x19MutateCustomerManagerLink\x12\x43.google.ads.googleads.v16.services.MutateCustomerManagerLinkRequest\x1a\x44.google.ads.googleads.v16.services.MutateCustomerManagerLinkResponse\"^\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02?\":/v16/customers/{customer_id=*}/customerManagerLinks:mutate:\x01*\x12\x92\x02\n\x0fMoveManagerLink\x12\x39.google.ads.googleads.v16.services.MoveManagerLinkRequest\x1a:.google.ads.googleads.v16.services.MoveManagerLinkResponse\"\x87\x01\xda\x41\x36\x63ustomer_id,previous_customer_manager_link,new_manager\x82\xd3\xe4\x93\x02H\"C/v16/customers/{customer_id=*}/customerManagerLinks:moveManagerLink:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8b\x02\n%com.google.ads.googleads.v16.servicesB\x1f\x43ustomerManagerLinkServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomerManagerLink", "google/ads/googleads/v16/resources/customer_manager_link.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerManagerLinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerManagerLinkRequest").msgclass + MoveManagerLinkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MoveManagerLinkRequest").msgclass + CustomerManagerLinkOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerManagerLinkOperation").msgclass + MutateCustomerManagerLinkResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerManagerLinkResponse").msgclass + MoveManagerLinkResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MoveManagerLinkResponse").msgclass + MutateCustomerManagerLinkResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerManagerLinkResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_manager_link_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_manager_link_service_services_pb.rb new file mode 100644 index 000000000..3d7c72853 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_manager_link_service_services_pb.rb @@ -0,0 +1,77 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_manager_link_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_manager_link_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerManagerLinkService + # Service to manage customer-manager links. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerManagerLinkService' + + # Updates customer manager links. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [ManagerLinkError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCustomerManagerLink, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerManagerLinkResponse + # Moves a client customer to a new manager customer. + # This simplifies the complex request that requires two operations to move + # a client customer to a new manager, for example: + # 1. Update operation with Status INACTIVE (previous manager) and, + # 2. Update operation with Status ACTIVE (new manager). + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MoveManagerLink, ::Google::Ads::GoogleAds::V16::Services::MoveManagerLinkRequest, ::Google::Ads::GoogleAds::V16::Services::MoveManagerLinkResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service.rb b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service.rb new file mode 100644 index 000000000..a2e31ea1e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_negative_criterion_service/credentials" +require "google/ads/google_ads/v16/services/customer_negative_criterion_service/paths" +require "google/ads/google_ads/v16/services/customer_negative_criterion_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customer negative criteria. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_negative_criterion_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client.new + # + module CustomerNegativeCriterionService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_negative_criterion_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_negative_criterion_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/client.rb new file mode 100644 index 000000000..b3d86a468 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/client.rb @@ -0,0 +1,449 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_negative_criterion_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerNegativeCriterionService + ## + # Client for the CustomerNegativeCriterionService service. + # + # Service to manage customer negative criteria. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_negative_criterion_service_stub + + ## + # Configure the CustomerNegativeCriterionService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerNegativeCriterionService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerNegativeCriterionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_negative_criterion_service_stub.universe_domain + end + + ## + # Create a new CustomerNegativeCriterionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerNegativeCriterionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_negative_criterion_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_negative_criterion_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or removes criteria. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CriterionError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_customer_negative_criteria(request, options = nil) + # Pass arguments to `mutate_customer_negative_criteria` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_negative_criteria(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_customer_negative_criteria` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose criteria are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionOperation, ::Hash>] + # Required. The list of operations to perform on individual criteria. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaRequest.new + # + # # Call the mutate_customer_negative_criteria method. + # result = client.mutate_customer_negative_criteria request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaResponse. + # p result + # + def mutate_customer_negative_criteria request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_negative_criteria.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_negative_criteria.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_negative_criteria.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_negative_criterion_service_stub.call_rpc :mutate_customer_negative_criteria, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerNegativeCriterionService API. + # + # This class represents the configuration for CustomerNegativeCriterionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_negative_criteria to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_negative_criteria.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerNegativeCriterionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_negative_criteria.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerNegativeCriterionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_negative_criteria` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_negative_criteria + + # @private + def initialize parent_rpcs = nil + mutate_customer_negative_criteria_config = parent_rpcs.mutate_customer_negative_criteria if parent_rpcs.respond_to? :mutate_customer_negative_criteria + @mutate_customer_negative_criteria = ::Gapic::Config::Method.new mutate_customer_negative_criteria_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/credentials.rb new file mode 100644 index 000000000..3e86a7d93 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerNegativeCriterionService + # Credentials for the CustomerNegativeCriterionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/paths.rb new file mode 100644 index 000000000..55605aa52 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerNegativeCriterionService + # Path helper methods for the CustomerNegativeCriterionService API. + module Paths + ## + # Create a fully-qualified CustomerNegativeCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerNegativeCriteria/{criterion_id}` + # + # @param customer_id [String] + # @param criterion_id [String] + # + # @return [::String] + def customer_negative_criterion_path customer_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerNegativeCriteria/#{criterion_id}" + end + + ## + # Create a fully-qualified MobileAppCategoryConstant resource string. + # + # The resource will be in the following format: + # + # `mobileAppCategoryConstants/{mobile_app_category_id}` + # + # @param mobile_app_category_id [String] + # + # @return [::String] + def mobile_app_category_constant_path mobile_app_category_id: + "mobileAppCategoryConstants/#{mobile_app_category_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service_pb.rb new file mode 100644 index 000000000..d422ab983 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_negative_criterion_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/customer_negative_criterion_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nKgoogle/ads/googleads/v16/services/customer_negative_criterion_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x44google/ads/googleads/v16/resources/customer_negative_criterion.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xbd\x02\n%MutateCustomerNegativeCriteriaRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12^\n\noperations\x18\x02 \x03(\x0b\x32\x45.google.ads.googleads.v16.services.CustomerNegativeCriterionOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xcd\x01\n\"CustomerNegativeCriterionOperation\x12O\n\x06\x63reate\x18\x01 \x01(\x0b\x32=.google.ads.googleads.v16.resources.CustomerNegativeCriterionH\x00\x12I\n\x06remove\x18\x02 \x01(\tB7\xfa\x41\x34\n2googleads.googleapis.com/CustomerNegativeCriterionH\x00\x42\x0b\n\toperation\"\xb5\x01\n&MutateCustomerNegativeCriteriaResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12X\n\x07results\x18\x02 \x03(\x0b\x32G.google.ads.googleads.v16.services.MutateCustomerNegativeCriteriaResult\"\xda\x01\n$MutateCustomerNegativeCriteriaResult\x12N\n\rresource_name\x18\x01 \x01(\tB7\xfa\x41\x34\n2googleads.googleapis.com/CustomerNegativeCriterion\x12\x62\n\x1b\x63ustomer_negative_criterion\x18\x02 \x01(\x0b\x32=.google.ads.googleads.v16.resources.CustomerNegativeCriterion2\x85\x03\n CustomerNegativeCriterionService\x12\x99\x02\n\x1eMutateCustomerNegativeCriteria\x12H.google.ads.googleads.v16.services.MutateCustomerNegativeCriteriaRequest\x1aI.google.ads.googleads.v16.services.MutateCustomerNegativeCriteriaResponse\"b\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x43\">/v16/customers/{customer_id=*}/customerNegativeCriteria:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x91\x02\n%com.google.ads.googleads.v16.servicesB%CustomerNegativeCriterionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CustomerNegativeCriterion", "google/ads/googleads/v16/resources/customer_negative_criterion.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerNegativeCriteriaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerNegativeCriteriaRequest").msgclass + CustomerNegativeCriterionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerNegativeCriterionOperation").msgclass + MutateCustomerNegativeCriteriaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerNegativeCriteriaResponse").msgclass + MutateCustomerNegativeCriteriaResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerNegativeCriteriaResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service_services_pb.rb new file mode 100644 index 000000000..6c56b1965 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_negative_criterion_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_negative_criterion_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_negative_criterion_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerNegativeCriterionService + # Proto file describing the Customer Negative Criterion service. + # + # Service to manage customer negative criteria. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerNegativeCriterionService' + + # Creates or removes criteria. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CriterionError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCustomerNegativeCriteria, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerNegativeCriteriaResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_service.rb b/lib/google/ads/google_ads/v16/services/customer_service.rb new file mode 100644 index 000000000..9bbe6fa19 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_service/credentials" +require "google/ads/google_ads/v16/services/customer_service/paths" +require "google/ads/google_ads/v16/services/customer_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customers. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerService::Client.new + # + module CustomerService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_service/client.rb new file mode 100644 index 000000000..514f220b2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_service/client.rb @@ -0,0 +1,649 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerService + ## + # Client for the CustomerService service. + # + # Service to manage customers. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_service_stub + + ## + # Configure the CustomerService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_service_stub.universe_domain + end + + ## + # Create a new CustomerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Updates a customer. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # [UrlFieldError]() + # + # @overload mutate_customer(request, options = nil) + # Pass arguments to `mutate_customer` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer(customer_id: nil, operation: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_customer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer being modified. + # @param operation [::Google::Ads::GoogleAds::V16::Services::CustomerOperation, ::Hash] + # Required. The operation to perform on the customer + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerRequest.new + # + # # Call the mutate_customer method. + # result = client.mutate_customer request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerResponse. + # p result + # + def mutate_customer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_service_stub.call_rpc :mutate_customer, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns resource names of customers directly accessible by the + # user authenticating the call. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload list_accessible_customers(request, options = nil) + # Pass arguments to `list_accessible_customers` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersRequest.new + # + # # Call the list_accessible_customers method. + # result = client.list_accessible_customers request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersResponse. + # p result + # + def list_accessible_customers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_accessible_customers.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_accessible_customers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_accessible_customers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_service_stub.call_rpc :list_accessible_customers, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Creates a new client under manager. The new client customer is returned. + # + # List of thrown errors: + # [AccessInvitationError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CurrencyCodeError]() + # [HeaderError]() + # [InternalError]() + # [ManagerLinkError]() + # [QuotaError]() + # [RequestError]() + # [StringLengthError]() + # [TimeZoneError]() + # + # @overload create_customer_client(request, options = nil) + # Pass arguments to `create_customer_client` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::CreateCustomerClientRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::CreateCustomerClientRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_customer_client(customer_id: nil, customer_client: nil, email_address: nil, access_role: nil, validate_only: nil) + # Pass arguments to `create_customer_client` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the Manager under whom client customer is being + # created. + # @param customer_client [::Google::Ads::GoogleAds::V16::Resources::Customer, ::Hash] + # Required. The new client customer to create. The resource name on this + # customer will be ignored. + # @param email_address [::String] + # Email address of the user who should be invited on the created client + # customer. Accessible only to customers on the allow-list. + # @param access_role [::Google::Ads::GoogleAds::V16::Enums::AccessRoleEnum::AccessRole] + # The proposed role of user on the created client customer. + # Accessible only to customers on the allow-list. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::CreateCustomerClientResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::CreateCustomerClientResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::CreateCustomerClientRequest.new + # + # # Call the create_customer_client method. + # result = client.create_customer_client request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::CreateCustomerClientResponse. + # p result + # + def create_customer_client request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::CreateCustomerClientRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_customer_client.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_customer_client.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_customer_client.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_service_stub.call_rpc :create_customer_client, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerService API. + # + # This class represents the configuration for CustomerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer + ## + # RPC-specific configuration for `list_accessible_customers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_accessible_customers + ## + # RPC-specific configuration for `create_customer_client` + # @return [::Gapic::Config::Method] + # + attr_reader :create_customer_client + + # @private + def initialize parent_rpcs = nil + mutate_customer_config = parent_rpcs.mutate_customer if parent_rpcs.respond_to? :mutate_customer + @mutate_customer = ::Gapic::Config::Method.new mutate_customer_config + list_accessible_customers_config = parent_rpcs.list_accessible_customers if parent_rpcs.respond_to? :list_accessible_customers + @list_accessible_customers = ::Gapic::Config::Method.new list_accessible_customers_config + create_customer_client_config = parent_rpcs.create_customer_client if parent_rpcs.respond_to? :create_customer_client + @create_customer_client = ::Gapic::Config::Method.new create_customer_client_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_service/credentials.rb new file mode 100644 index 000000000..c064ab18f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerService + # Credentials for the CustomerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_service/paths.rb new file mode 100644 index 000000000..66dc038cd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerService + # Path helper methods for the CustomerService API. + module Paths + ## + # Create a fully-qualified ConversionAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionActions/{conversion_action_id}` + # + # @param customer_id [String] + # @param conversion_action_id [String] + # + # @return [::String] + def conversion_action_path customer_id:, conversion_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionActions/#{conversion_action_id}" + end + + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_service_pb.rb new file mode 100644 index 000000000..0fdc7ec1c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/access_role_pb' +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/customer_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n8google/ads/googleads/v16/services/customer_service.proto\x12!google.ads.googleads.v16.services\x1a\x30google/ads/googleads/v16/enums/access_role.proto\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x31google/ads/googleads/v16/resources/customer.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\x82\x02\n\x15MutateCustomerRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\toperation\x18\x04 \x01(\x0b\x32\x34.google.ads.googleads.v16.services.CustomerOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x05 \x01(\x08\x12j\n\x15response_content_type\x18\x06 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x98\x02\n\x1b\x43reateCustomerClientRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\x0f\x63ustomer_client\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.CustomerB\x03\xe0\x41\x02\x12\x1a\n\remail_address\x18\x05 \x01(\tH\x00\x88\x01\x01\x12N\n\x0b\x61\x63\x63\x65ss_role\x18\x04 \x01(\x0e\x32\x39.google.ads.googleads.v16.enums.AccessRoleEnum.AccessRole\x12\x15\n\rvalidate_only\x18\x06 \x01(\x08\x42\x10\n\x0e_email_address\"\x82\x01\n\x11\x43ustomerOperation\x12<\n\x06update\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.Customer\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"v\n\x1c\x43reateCustomerClientResponse\x12=\n\rresource_name\x18\x02 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/Customer\x12\x17\n\x0finvitation_link\x18\x03 \x01(\t\"a\n\x16MutateCustomerResponse\x12G\n\x06result\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.services.MutateCustomerResult\"\x95\x01\n\x14MutateCustomerResult\x12=\n\rresource_name\x18\x01 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/Customer\x12>\n\x08\x63ustomer\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.Customer\" \n\x1eListAccessibleCustomersRequest\"9\n\x1fListAccessibleCustomersResponse\x12\x16\n\x0eresource_names\x18\x01 \x03(\t2\xf5\x05\n\x0f\x43ustomerService\x12\xcf\x01\n\x0eMutateCustomer\x12\x38.google.ads.googleads.v16.services.MutateCustomerRequest\x1a\x39.google.ads.googleads.v16.services.MutateCustomerResponse\"H\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02*\"%/v16/customers/{customer_id=*}:mutate:\x01*\x12\xd0\x01\n\x17ListAccessibleCustomers\x12\x41.google.ads.googleads.v16.services.ListAccessibleCustomersRequest\x1a\x42.google.ads.googleads.v16.services.ListAccessibleCustomersResponse\".\x82\xd3\xe4\x93\x02(\x12&/v16/customers:listAccessibleCustomers\x12\xf5\x01\n\x14\x43reateCustomerClient\x12>.google.ads.googleads.v16.services.CreateCustomerClientRequest\x1a?.google.ads.googleads.v16.services.CreateCustomerClientResponse\"\\\xda\x41\x1b\x63ustomer_id,customer_client\x82\xd3\xe4\x93\x02\x38\"3/v16/customers/{customer_id=*}:createCustomerClient:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x80\x02\n%com.google.ads.googleads.v16.servicesB\x14\x43ustomerServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.Customer", "google/ads/googleads/v16/resources/customer.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerRequest").msgclass + CreateCustomerClientRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CreateCustomerClientRequest").msgclass + CustomerOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerOperation").msgclass + CreateCustomerClientResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CreateCustomerClientResponse").msgclass + MutateCustomerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerResponse").msgclass + MutateCustomerResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerResult").msgclass + ListAccessibleCustomersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListAccessibleCustomersRequest").msgclass + ListAccessibleCustomersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListAccessibleCustomersResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_service_services_pb.rb new file mode 100644 index 000000000..f949fc178 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_service_services_pb.rb @@ -0,0 +1,86 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerService + # Proto file describing the Customer service. + # + # Service to manage customers. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerService' + + # Updates a customer. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # [UrlFieldError]() + rpc :MutateCustomer, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerResponse + # Returns resource names of customers directly accessible by the + # user authenticating the call. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :ListAccessibleCustomers, ::Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersRequest, ::Google::Ads::GoogleAds::V16::Services::ListAccessibleCustomersResponse + # Creates a new client under manager. The new client customer is returned. + # + # List of thrown errors: + # [AccessInvitationError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [CurrencyCodeError]() + # [HeaderError]() + # [InternalError]() + # [ManagerLinkError]() + # [QuotaError]() + # [RequestError]() + # [StringLengthError]() + # [TimeZoneError]() + rpc :CreateCustomerClient, ::Google::Ads::GoogleAds::V16::Services::CreateCustomerClientRequest, ::Google::Ads::GoogleAds::V16::Services::CreateCustomerClientResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service.rb b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service.rb new file mode 100644 index 000000000..5829980cd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/credentials" +require "google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/paths" +require "google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage CustomerSkAdNetworkConversionValueSchema. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client.new + # + module CustomerSkAdNetworkConversionValueSchemaService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_sk_ad_network_conversion_value_schema_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/client.rb new file mode 100644 index 000000000..1a5c92bea --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/client.rb @@ -0,0 +1,436 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerSkAdNetworkConversionValueSchemaService + ## + # Client for the CustomerSkAdNetworkConversionValueSchemaService service. + # + # Service to manage CustomerSkAdNetworkConversionValueSchema. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_sk_ad_network_conversion_value_schema_service_stub + + ## + # Configure the CustomerSkAdNetworkConversionValueSchemaService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerSkAdNetworkConversionValueSchemaService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerSkAdNetworkConversionValueSchemaService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_sk_ad_network_conversion_value_schema_service_stub.universe_domain + end + + ## + # Create a new CustomerSkAdNetworkConversionValueSchemaService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerSkAdNetworkConversionValueSchemaService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_sk_ad_network_conversion_value_schema_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or updates the CustomerSkAdNetworkConversionValueSchema. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [InternalError]() + # [MutateError]() + # + # @overload mutate_customer_sk_ad_network_conversion_value_schema(request, options = nil) + # Pass arguments to `mutate_customer_sk_ad_network_conversion_value_schema` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_sk_ad_network_conversion_value_schema(customer_id: nil, operation: nil, validate_only: nil) + # Pass arguments to `mutate_customer_sk_ad_network_conversion_value_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # The ID of the customer whose shared sets are being modified. + # @param operation [::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaOperation, ::Hash] + # The operation to perform. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaRequest.new + # + # # Call the mutate_customer_sk_ad_network_conversion_value_schema method. + # result = client.mutate_customer_sk_ad_network_conversion_value_schema request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaResponse. + # p result + # + def mutate_customer_sk_ad_network_conversion_value_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_sk_ad_network_conversion_value_schema.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_sk_ad_network_conversion_value_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_sk_ad_network_conversion_value_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_sk_ad_network_conversion_value_schema_service_stub.call_rpc :mutate_customer_sk_ad_network_conversion_value_schema, + request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerSkAdNetworkConversionValueSchemaService API. + # + # This class represents the configuration for CustomerSkAdNetworkConversionValueSchemaService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_sk_ad_network_conversion_value_schema to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_sk_ad_network_conversion_value_schema.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerSkAdNetworkConversionValueSchemaService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_sk_ad_network_conversion_value_schema.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerSkAdNetworkConversionValueSchemaService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_sk_ad_network_conversion_value_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_sk_ad_network_conversion_value_schema + + # @private + def initialize parent_rpcs = nil + mutate_customer_sk_ad_network_conversion_value_schema_config = parent_rpcs.mutate_customer_sk_ad_network_conversion_value_schema if parent_rpcs.respond_to? :mutate_customer_sk_ad_network_conversion_value_schema + @mutate_customer_sk_ad_network_conversion_value_schema = ::Gapic::Config::Method.new mutate_customer_sk_ad_network_conversion_value_schema_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/credentials.rb new file mode 100644 index 000000000..c2e9ae2cc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerSkAdNetworkConversionValueSchemaService + # Credentials for the CustomerSkAdNetworkConversionValueSchemaService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/paths.rb new file mode 100644 index 000000000..564bda224 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerSkAdNetworkConversionValueSchemaService + # Path helper methods for the CustomerSkAdNetworkConversionValueSchemaService API. + module Paths + ## + # Create a fully-qualified CustomerSkAdNetworkConversionValueSchema resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerSkAdNetworkConversionValueSchemas/{account_link_id}` + # + # @param customer_id [String] + # @param account_link_id [String] + # + # @return [::String] + def customer_sk_ad_network_conversion_value_schema_path customer_id:, account_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerSkAdNetworkConversionValueSchemas/#{account_link_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_pb.rb new file mode 100644 index 000000000..da1ccd3fc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_sk_ad_network_conversion_value_schema_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/customer_sk_ad_network_conversion_value_schema_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n^google/ads/googleads/v16/services/customer_sk_ad_network_conversion_value_schema_service.proto\x12!google.ads.googleads.v16.services\x1aWgoogle/ads/googleads/v16/resources/customer_sk_ad_network_conversion_value_schema.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x19google/api/resource.proto\"\x91\x01\n1CustomerSkAdNetworkConversionValueSchemaOperation\x12\\\n\x06update\x18\x01 \x01(\x0b\x32L.google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema\"\xcc\x01\n5MutateCustomerSkAdNetworkConversionValueSchemaRequest\x12\x13\n\x0b\x63ustomer_id\x18\x01 \x01(\t\x12g\n\toperation\x18\x02 \x01(\x0b\x32T.google.ads.googleads.v16.services.CustomerSkAdNetworkConversionValueSchemaOperation\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa5\x01\n4MutateCustomerSkAdNetworkConversionValueSchemaResult\x12]\n\rresource_name\x18\x01 \x01(\tBF\xfa\x41\x43\nAgoogleads.googleapis.com/CustomerSkAdNetworkConversionValueSchema\x12\x0e\n\x06\x61pp_id\x18\x02 \x01(\t\"\xa1\x01\n6MutateCustomerSkAdNetworkConversionValueSchemaResponse\x12g\n\x06result\x18\x01 \x01(\x0b\x32W.google.ads.googleads.v16.services.MutateCustomerSkAdNetworkConversionValueSchemaResult2\xbc\x03\n/CustomerSkAdNetworkConversionValueSchemaService\x12\xc1\x02\n.MutateCustomerSkAdNetworkConversionValueSchema\x12X.google.ads.googleads.v16.services.MutateCustomerSkAdNetworkConversionValueSchemaRequest\x1aY.google.ads.googleads.v16.services.MutateCustomerSkAdNetworkConversionValueSchemaResponse\"Z\x82\xd3\xe4\x93\x02T\"O/v16/customers/{customer_id=*}/customerSkAdNetworkConversionValueSchemas:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\xa0\x02\n%com.google.ads.googleads.v16.servicesB4CustomerSkAdNetworkConversionValueSchemaServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CustomerSkAdNetworkConversionValueSchema", "google/ads/googleads/v16/resources/customer_sk_ad_network_conversion_value_schema.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + CustomerSkAdNetworkConversionValueSchemaOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerSkAdNetworkConversionValueSchemaOperation").msgclass + MutateCustomerSkAdNetworkConversionValueSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerSkAdNetworkConversionValueSchemaRequest").msgclass + MutateCustomerSkAdNetworkConversionValueSchemaResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerSkAdNetworkConversionValueSchemaResult").msgclass + MutateCustomerSkAdNetworkConversionValueSchemaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerSkAdNetworkConversionValueSchemaResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_services_pb.rb new file mode 100644 index 000000000..e05414951 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_sk_ad_network_conversion_value_schema_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_sk_ad_network_conversion_value_schema_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerSkAdNetworkConversionValueSchemaService + # Proto file describing the Customer Negative Criterion service. + # + # Service to manage CustomerSkAdNetworkConversionValueSchema. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerSkAdNetworkConversionValueSchemaService' + + # Creates or updates the CustomerSkAdNetworkConversionValueSchema. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [InternalError]() + # [MutateError]() + rpc :MutateCustomerSkAdNetworkConversionValueSchema, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerSkAdNetworkConversionValueSchemaResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service.rb new file mode 100644 index 000000000..6fa3d7510 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_user_access_invitation_service/credentials" +require "google/ads/google_ads/v16/services/customer_user_access_invitation_service/paths" +require "google/ads/google_ads/v16/services/customer_user_access_invitation_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # This service manages the access invitation extended to users for a given + # customer. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_user_access_invitation_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client.new + # + module CustomerUserAccessInvitationService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_user_access_invitation_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_user_access_invitation_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/client.rb new file mode 100644 index 000000000..aff6673c3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/client.rb @@ -0,0 +1,436 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_user_access_invitation_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerUserAccessInvitationService + ## + # Client for the CustomerUserAccessInvitationService service. + # + # This service manages the access invitation extended to users for a given + # customer. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_user_access_invitation_service_stub + + ## + # Configure the CustomerUserAccessInvitationService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerUserAccessInvitationService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerUserAccessInvitationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_user_access_invitation_service_stub.universe_domain + end + + ## + # Create a new CustomerUserAccessInvitationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerUserAccessInvitationService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_user_access_invitation_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_user_access_invitation_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or removes an access invitation. + # + # List of thrown errors: + # [AccessInvitationError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_customer_user_access_invitation(request, options = nil) + # Pass arguments to `mutate_customer_user_access_invitation` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_user_access_invitation(customer_id: nil, operation: nil) + # Pass arguments to `mutate_customer_user_access_invitation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose access invitation is being modified. + # @param operation [::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationOperation, ::Hash] + # Required. The operation to perform on the access invitation + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationRequest.new + # + # # Call the mutate_customer_user_access_invitation method. + # result = client.mutate_customer_user_access_invitation request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationResponse. + # p result + # + def mutate_customer_user_access_invitation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_user_access_invitation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_user_access_invitation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_user_access_invitation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_user_access_invitation_service_stub.call_rpc :mutate_customer_user_access_invitation, + request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerUserAccessInvitationService API. + # + # This class represents the configuration for CustomerUserAccessInvitationService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_user_access_invitation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_user_access_invitation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_user_access_invitation.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerUserAccessInvitationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_user_access_invitation` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_user_access_invitation + + # @private + def initialize parent_rpcs = nil + mutate_customer_user_access_invitation_config = parent_rpcs.mutate_customer_user_access_invitation if parent_rpcs.respond_to? :mutate_customer_user_access_invitation + @mutate_customer_user_access_invitation = ::Gapic::Config::Method.new mutate_customer_user_access_invitation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/credentials.rb new file mode 100644 index 000000000..b45ef0707 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerUserAccessInvitationService + # Credentials for the CustomerUserAccessInvitationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/paths.rb new file mode 100644 index 000000000..dc1d0b132 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerUserAccessInvitationService + # Path helper methods for the CustomerUserAccessInvitationService API. + module Paths + ## + # Create a fully-qualified CustomerUserAccessInvitation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerUserAccessInvitations/{invitation_id}` + # + # @param customer_id [String] + # @param invitation_id [String] + # + # @return [::String] + def customer_user_access_invitation_path customer_id:, invitation_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerUserAccessInvitations/#{invitation_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service_pb.rb new file mode 100644 index 000000000..36cf5236b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_user_access_invitation_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/customer_user_access_invitation_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nOgoogle/ads/googleads/v16/services/customer_user_access_invitation_service.proto\x12!google.ads.googleads.v16.services\x1aHgoogle/ads/googleads/v16/resources/customer_user_access_invitation.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa7\x01\n)MutateCustomerUserAccessInvitationRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12`\n\toperation\x18\x02 \x01(\x0b\x32H.google.ads.googleads.v16.services.CustomerUserAccessInvitationOperationB\x03\xe0\x41\x02\"\xd6\x01\n%CustomerUserAccessInvitationOperation\x12R\n\x06\x63reate\x18\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.CustomerUserAccessInvitationH\x00\x12L\n\x06remove\x18\x02 \x01(\tB:\xfa\x41\x37\n5googleads.googleapis.com/CustomerUserAccessInvitationH\x00\x42\x0b\n\toperation\"\x89\x01\n*MutateCustomerUserAccessInvitationResponse\x12[\n\x06result\x18\x01 \x01(\x0b\x32K.google.ads.googleads.v16.services.MutateCustomerUserAccessInvitationResult\"}\n(MutateCustomerUserAccessInvitationResult\x12Q\n\rresource_name\x18\x01 \x01(\tB:\xfa\x41\x37\n5googleads.googleapis.com/CustomerUserAccessInvitation2\x98\x03\n#CustomerUserAccessInvitationService\x12\xa9\x02\n\"MutateCustomerUserAccessInvitation\x12L.google.ads.googleads.v16.services.MutateCustomerUserAccessInvitationRequest\x1aM.google.ads.googleads.v16.services.MutateCustomerUserAccessInvitationResponse\"f\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02H\"C/v16/customers/{customer_id=*}/customerUserAccessInvitations:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x94\x02\n%com.google.ads.googleads.v16.servicesB(CustomerUserAccessInvitationServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.CustomerUserAccessInvitation", "google/ads/googleads/v16/resources/customer_user_access_invitation.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerUserAccessInvitationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerUserAccessInvitationRequest").msgclass + CustomerUserAccessInvitationOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerUserAccessInvitationOperation").msgclass + MutateCustomerUserAccessInvitationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerUserAccessInvitationResponse").msgclass + MutateCustomerUserAccessInvitationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerUserAccessInvitationResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service_services_pb.rb new file mode 100644 index 000000000..33862ef96 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_invitation_service_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_user_access_invitation_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_user_access_invitation_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerUserAccessInvitationService + # Proto file describing the CustomerUserAccessInvitation service. + # + # This service manages the access invitation extended to users for a given + # customer. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerUserAccessInvitationService' + + # Creates or removes an access invitation. + # + # List of thrown errors: + # [AccessInvitationError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCustomerUserAccessInvitation, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_service.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_service.rb new file mode 100644 index 000000000..73b655b80 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customer_user_access_service/credentials" +require "google/ads/google_ads/v16/services/customer_user_access_service/paths" +require "google/ads/google_ads/v16/services/customer_user_access_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # This service manages the permissions of a user on a given customer. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customer_user_access_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client.new + # + module CustomerUserAccessService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customer_user_access_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customer_user_access_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_service/client.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_service/client.rb new file mode 100644 index 000000000..36d856a94 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_service/client.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customer_user_access_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerUserAccessService + ## + # Client for the CustomerUserAccessService service. + # + # This service manages the permissions of a user on a given customer. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customer_user_access_service_stub + + ## + # Configure the CustomerUserAccessService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomerUserAccessService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomerUserAccessService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customer_user_access_service_stub.universe_domain + end + + ## + # Create a new CustomerUserAccessService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomerUserAccessService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customer_user_access_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customer_user_access_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Updates, removes permission of a user on a given customer. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CustomerUserAccessError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_customer_user_access(request, options = nil) + # Pass arguments to `mutate_customer_user_access` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customer_user_access(customer_id: nil, operation: nil) + # Pass arguments to `mutate_customer_user_access` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer being modified. + # @param operation [::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessOperation, ::Hash] + # Required. The operation to perform on the customer + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessRequest.new + # + # # Call the mutate_customer_user_access method. + # result = client.mutate_customer_user_access request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessResponse. + # p result + # + def mutate_customer_user_access request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customer_user_access.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customer_user_access.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customer_user_access.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customer_user_access_service_stub.call_rpc :mutate_customer_user_access, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomerUserAccessService API. + # + # This class represents the configuration for CustomerUserAccessService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customer_user_access to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_user_access.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomerUserAccessService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customer_user_access.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomerUserAccessService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customer_user_access` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customer_user_access + + # @private + def initialize parent_rpcs = nil + mutate_customer_user_access_config = parent_rpcs.mutate_customer_user_access if parent_rpcs.respond_to? :mutate_customer_user_access + @mutate_customer_user_access = ::Gapic::Config::Method.new mutate_customer_user_access_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_service/credentials.rb new file mode 100644 index 000000000..ce08db2f9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerUserAccessService + # Credentials for the CustomerUserAccessService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_service/paths.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_service/paths.rb new file mode 100644 index 000000000..fca44970d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerUserAccessService + # Path helper methods for the CustomerUserAccessService API. + module Paths + ## + # Create a fully-qualified CustomerUserAccess resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerUserAccesses/{user_id}` + # + # @param customer_id [String] + # @param user_id [String] + # + # @return [::String] + def customer_user_access_path customer_id:, user_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerUserAccesses/#{user_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_service_pb.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_service_pb.rb new file mode 100644 index 000000000..0312b2584 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customer_user_access_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/customer_user_access_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/services/customer_user_access_service.proto\x12!google.ads.googleads.v16.services\x1a=google/ads/googleads/v16/resources/customer_user_access.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\x93\x01\n\x1fMutateCustomerUserAccessRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12V\n\toperation\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.services.CustomerUserAccessOperationB\x03\xe0\x41\x02\"\xe9\x01\n\x1b\x43ustomerUserAccessOperation\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12H\n\x06update\x18\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CustomerUserAccessH\x00\x12\x42\n\x06remove\x18\x02 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/CustomerUserAccessH\x00\x42\x0b\n\toperation\"u\n MutateCustomerUserAccessResponse\x12Q\n\x06result\x18\x01 \x01(\x0b\x32\x41.google.ads.googleads.v16.services.MutateCustomerUserAccessResult\"i\n\x1eMutateCustomerUserAccessResult\x12G\n\rresource_name\x18\x01 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/CustomerUserAccess2\xe7\x02\n\x19\x43ustomerUserAccessService\x12\x82\x02\n\x18MutateCustomerUserAccess\x12\x42.google.ads.googleads.v16.services.MutateCustomerUserAccessRequest\x1a\x43.google.ads.googleads.v16.services.MutateCustomerUserAccessResponse\"]\xda\x41\x15\x63ustomer_id,operation\x82\xd3\xe4\x93\x02?\":/v16/customers/{customer_id=*}/customerUserAccesses:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8a\x02\n%com.google.ads.googleads.v16.servicesB\x1e\x43ustomerUserAccessServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomerUserAccess", "google/ads/googleads/v16/resources/customer_user_access.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomerUserAccessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerUserAccessRequest").msgclass + CustomerUserAccessOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomerUserAccessOperation").msgclass + MutateCustomerUserAccessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerUserAccessResponse").msgclass + MutateCustomerUserAccessResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomerUserAccessResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customer_user_access_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customer_user_access_service_services_pb.rb new file mode 100644 index 000000000..5df55f583 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customer_user_access_service_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customer_user_access_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customer_user_access_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomerUserAccessService + # This service manages the permissions of a user on a given customer. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomerUserAccessService' + + # Updates, removes permission of a user on a given customer. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CustomerUserAccessError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateCustomerUserAccess, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customizer_attribute_service.rb b/lib/google/ads/google_ads/v16/services/customizer_attribute_service.rb new file mode 100644 index 000000000..a0788d2b3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customizer_attribute_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/customizer_attribute_service/credentials" +require "google/ads/google_ads/v16/services/customizer_attribute_service/paths" +require "google/ads/google_ads/v16/services/customizer_attribute_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage customizer attribute + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/customizer_attribute_service" + # client = ::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client.new + # + module CustomizerAttributeService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "customizer_attribute_service", "helpers.rb" +require "google/ads/google_ads/v16/services/customizer_attribute_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/customizer_attribute_service/client.rb b/lib/google/ads/google_ads/v16/services/customizer_attribute_service/client.rb new file mode 100644 index 000000000..37a8643c4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customizer_attribute_service/client.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/customizer_attribute_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomizerAttributeService + ## + # Client for the CustomizerAttributeService service. + # + # Service to manage customizer attribute + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :customizer_attribute_service_stub + + ## + # Configure the CustomizerAttributeService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CustomizerAttributeService clients + # ::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CustomizerAttributeService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @customizer_attribute_service_stub.universe_domain + end + + ## + # Create a new CustomizerAttributeService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CustomizerAttributeService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/customizer_attribute_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @customizer_attribute_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes customizer attributes. Operation statuses are + # returned. + # + # @overload mutate_customizer_attributes(request, options = nil) + # Pass arguments to `mutate_customizer_attributes` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_customizer_attributes(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_customizer_attributes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose customizer attributes are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeOperation, ::Hash>] + # Required. The list of operations to perform on individual customizer + # attributes. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesRequest.new + # + # # Call the mutate_customizer_attributes method. + # result = client.mutate_customizer_attributes request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesResponse. + # p result + # + def mutate_customizer_attributes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_customizer_attributes.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_customizer_attributes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_customizer_attributes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @customizer_attribute_service_stub.call_rpc :mutate_customizer_attributes, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the CustomizerAttributeService API. + # + # This class represents the configuration for CustomizerAttributeService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_customizer_attributes to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customizer_attributes.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::CustomizerAttributeService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_customizer_attributes.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CustomizerAttributeService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_customizer_attributes` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_customizer_attributes + + # @private + def initialize parent_rpcs = nil + mutate_customizer_attributes_config = parent_rpcs.mutate_customizer_attributes if parent_rpcs.respond_to? :mutate_customizer_attributes + @mutate_customizer_attributes = ::Gapic::Config::Method.new mutate_customizer_attributes_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customizer_attribute_service/credentials.rb b/lib/google/ads/google_ads/v16/services/customizer_attribute_service/credentials.rb new file mode 100644 index 000000000..b3d633a1b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customizer_attribute_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomizerAttributeService + # Credentials for the CustomizerAttributeService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customizer_attribute_service/paths.rb b/lib/google/ads/google_ads/v16/services/customizer_attribute_service/paths.rb new file mode 100644 index 000000000..6ac072747 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customizer_attribute_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomizerAttributeService + # Path helper methods for the CustomizerAttributeService API. + module Paths + ## + # Create a fully-qualified CustomizerAttribute resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customizerAttributes/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customizer_attribute_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customizerAttributes/#{customizer_attribute_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customizer_attribute_service_pb.rb b/lib/google/ads/google_ads/v16/services/customizer_attribute_service_pb.rb new file mode 100644 index 000000000..a2fa467a5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customizer_attribute_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/customizer_attribute_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/customizer_attribute_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nDgoogle/ads/googleads/v16/services/customizer_attribute_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a=google/ads/googleads/v16/resources/customizer_attribute.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb3\x02\n!MutateCustomizerAttributesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12X\n\noperations\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.services.CustomizerAttributeOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xec\x01\n\x1c\x43ustomizerAttributeOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12I\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CustomizerAttributeH\x00\x12\x43\n\x06remove\x18\x02 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/CustomizerAttributeH\x00\x42\x0b\n\toperation\"\xac\x01\n\"MutateCustomizerAttributesResponse\x12S\n\x07results\x18\x01 \x03(\x0b\x32\x42.google.ads.googleads.v16.services.MutateCustomizerAttributeResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xc2\x01\n\x1fMutateCustomizerAttributeResult\x12H\n\rresource_name\x18\x01 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/CustomizerAttribute\x12U\n\x14\x63ustomizer_attribute\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CustomizerAttribute2\xef\x02\n\x1a\x43ustomizerAttributeService\x12\x89\x02\n\x1aMutateCustomizerAttributes\x12\x44.google.ads.googleads.v16.services.MutateCustomizerAttributesRequest\x1a\x45.google.ads.googleads.v16.services.MutateCustomizerAttributesResponse\"^\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02?\":/v16/customers/{customer_id=*}/customizerAttributes:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8b\x02\n%com.google.ads.googleads.v16.servicesB\x1f\x43ustomizerAttributeServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.CustomizerAttribute", "google/ads/googleads/v16/resources/customizer_attribute.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateCustomizerAttributesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomizerAttributesRequest").msgclass + CustomizerAttributeOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CustomizerAttributeOperation").msgclass + MutateCustomizerAttributesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomizerAttributesResponse").msgclass + MutateCustomizerAttributeResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateCustomizerAttributeResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/customizer_attribute_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/customizer_attribute_service_services_pb.rb new file mode 100644 index 000000000..94217fc49 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/customizer_attribute_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/customizer_attribute_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/customizer_attribute_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module CustomizerAttributeService + # Proto file describing the CustomizerAttribute service. + # + # Service to manage customizer attribute + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.CustomizerAttributeService' + + # Creates, updates or removes customizer attributes. Operation statuses are + # returned. + rpc :MutateCustomizerAttributes, ::Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesRequest, ::Google::Ads::GoogleAds::V16::Services::MutateCustomizerAttributesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_arm_service.rb b/lib/google/ads/google_ads/v16/services/experiment_arm_service.rb new file mode 100644 index 000000000..e106a7a4b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_arm_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/experiment_arm_service/credentials" +require "google/ads/google_ads/v16/services/experiment_arm_service/paths" +require "google/ads/google_ads/v16/services/experiment_arm_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage experiment arms. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/experiment_arm_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client.new + # + module ExperimentArmService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "experiment_arm_service", "helpers.rb" +require "google/ads/google_ads/v16/services/experiment_arm_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/experiment_arm_service/client.rb b/lib/google/ads/google_ads/v16/services/experiment_arm_service/client.rb new file mode 100644 index 000000000..4b5fe3337 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_arm_service/client.rb @@ -0,0 +1,447 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/experiment_arm_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExperimentArmService + ## + # Client for the ExperimentArmService service. + # + # Service to manage experiment arms. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :experiment_arm_service_stub + + ## + # Configure the ExperimentArmService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ExperimentArmService clients + # ::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ExperimentArmService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @experiment_arm_service_stub.universe_domain + end + + ## + # Create a new ExperimentArmService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ExperimentArmService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/experiment_arm_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @experiment_arm_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes experiment arms. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ExperimentArmError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_experiment_arms(request, options = nil) + # Pass arguments to `mutate_experiment_arms` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_experiment_arms(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_experiment_arms` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose experiments are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::ExperimentArmOperation, ::Hash>] + # Required. The list of operations to perform on individual experiment arm. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsRequest.new + # + # # Call the mutate_experiment_arms method. + # result = client.mutate_experiment_arms request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsResponse. + # p result + # + def mutate_experiment_arms request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_experiment_arms.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_experiment_arms.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_experiment_arms.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiment_arm_service_stub.call_rpc :mutate_experiment_arms, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ExperimentArmService API. + # + # This class represents the configuration for ExperimentArmService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_experiment_arms to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_experiment_arms.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ExperimentArmService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_experiment_arms.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ExperimentArmService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_experiment_arms` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_experiment_arms + + # @private + def initialize parent_rpcs = nil + mutate_experiment_arms_config = parent_rpcs.mutate_experiment_arms if parent_rpcs.respond_to? :mutate_experiment_arms + @mutate_experiment_arms = ::Gapic::Config::Method.new mutate_experiment_arms_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_arm_service/credentials.rb b/lib/google/ads/google_ads/v16/services/experiment_arm_service/credentials.rb new file mode 100644 index 000000000..ca1ccc142 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_arm_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExperimentArmService + # Credentials for the ExperimentArmService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_arm_service/paths.rb b/lib/google/ads/google_ads/v16/services/experiment_arm_service/paths.rb new file mode 100644 index 000000000..2ec1bd3e5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_arm_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExperimentArmService + # Path helper methods for the ExperimentArmService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified Experiment resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/experiments/{trial_id}` + # + # @param customer_id [String] + # @param trial_id [String] + # + # @return [::String] + def experiment_path customer_id:, trial_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/experiments/#{trial_id}" + end + + ## + # Create a fully-qualified ExperimentArm resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/experimentArms/{trial_id}~{trial_arm_id}` + # + # @param customer_id [String] + # @param trial_id [String] + # @param trial_arm_id [String] + # + # @return [::String] + def experiment_arm_path customer_id:, trial_id:, trial_arm_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "trial_id cannot contain /" if trial_id.to_s.include? "/" + + "customers/#{customer_id}/experimentArms/#{trial_id}~#{trial_arm_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_arm_service_pb.rb b/lib/google/ads/google_ads/v16/services/experiment_arm_service_pb.rb new file mode 100644 index 000000000..9851b6452 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_arm_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/experiment_arm_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/experiment_arm_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/experiment_arm_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x37google/ads/googleads/v16/resources/experiment_arm.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa7\x02\n\x1bMutateExperimentArmsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\noperations\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.ExperimentArmOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x9f\x02\n\x16\x45xperimentArmOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.ExperimentArmH\x00\x12\x43\n\x06update\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.ExperimentArmH\x00\x12=\n\x06remove\x18\x03 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/ExperimentArmH\x00\x42\x0b\n\toperation\"\xa0\x01\n\x1cMutateExperimentArmsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12M\n\x07results\x18\x02 \x03(\x0b\x32<.google.ads.googleads.v16.services.MutateExperimentArmResult\"\xaa\x01\n\x19MutateExperimentArmResult\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xfa\x41(\n&googleads.googleapis.com/ExperimentArm\x12I\n\x0e\x65xperiment_arm\x18\x02 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.ExperimentArm2\xd1\x02\n\x14\x45xperimentArmService\x12\xf1\x01\n\x14MutateExperimentArms\x12>.google.ads.googleads.v16.services.MutateExperimentArmsRequest\x1a?.google.ads.googleads.v16.services.MutateExperimentArmsResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/experimentArms:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x85\x02\n%com.google.ads.googleads.v16.servicesB\x19\x45xperimentArmServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.ExperimentArm", "google/ads/googleads/v16/resources/experiment_arm.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateExperimentArmsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateExperimentArmsRequest").msgclass + ExperimentArmOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ExperimentArmOperation").msgclass + MutateExperimentArmsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateExperimentArmsResponse").msgclass + MutateExperimentArmResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateExperimentArmResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_arm_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/experiment_arm_service_services_pb.rb new file mode 100644 index 000000000..54a2b8ac2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_arm_service_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/experiment_arm_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/experiment_arm_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExperimentArmService + # Proto file describing the Experiment Arm service. + # + # Service to manage experiment arms. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ExperimentArmService' + + # Creates, updates, or removes experiment arms. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ExperimentArmError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateExperimentArms, ::Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateExperimentArmsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_service.rb b/lib/google/ads/google_ads/v16/services/experiment_service.rb new file mode 100644 index 000000000..6ad951b24 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/experiment_service/credentials" +require "google/ads/google_ads/v16/services/experiment_service/paths" +require "google/ads/google_ads/v16/services/experiment_service/operations" +require "google/ads/google_ads/v16/services/experiment_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage experiments. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/experiment_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new + # + module ExperimentService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "experiment_service", "helpers.rb" +require "google/ads/google_ads/v16/services/experiment_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/experiment_service/client.rb b/lib/google/ads/google_ads/v16/services/experiment_service/client.rb new file mode 100644 index 000000000..9707acb75 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_service/client.rb @@ -0,0 +1,1044 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/experiment_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExperimentService + ## + # Client for the ExperimentService service. + # + # Service to manage experiments. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :experiment_service_stub + + ## + # Configure the ExperimentService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ExperimentService clients + # ::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ExperimentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @experiment_service_stub.universe_domain + end + + ## + # Create a new ExperimentService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ExperimentService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/experiment_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @experiment_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ExperimentService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Ads::GoogleAds::V16::Services::ExperimentService::Operations] + # + attr_reader :operations_client + + # Service calls + + ## + # Creates, updates, or removes experiments. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ExperimentError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_experiments(request, options = nil) + # Pass arguments to `mutate_experiments` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateExperimentsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateExperimentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_experiments(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_experiments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose experiments are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::ExperimentOperation, ::Hash>] + # Required. The list of operations to perform on individual experiments. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateExperimentsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateExperimentsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateExperimentsRequest.new + # + # # Call the mutate_experiments method. + # result = client.mutate_experiments request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateExperimentsResponse. + # p result + # + def mutate_experiments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateExperimentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_experiments.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_experiments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_experiments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiment_service_stub.call_rpc :mutate_experiments, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Immediately ends an experiment, changing the experiment's scheduled + # end date and without waiting for end of day. End date is updated to be the + # time of the request. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ExperimentError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload end_experiment(request, options = nil) + # Pass arguments to `end_experiment` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::EndExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::EndExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload end_experiment(experiment: nil, validate_only: nil) + # Pass arguments to `end_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param experiment [::String] + # Required. The resource name of the campaign experiment to end. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::EndExperimentRequest.new + # + # # Call the end_experiment method. + # result = client.end_experiment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def end_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::EndExperimentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.end_experiment.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.experiment + header_params["experiment"] = request.experiment + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.end_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.end_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiment_service_stub.call_rpc :end_experiment, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns all errors that occurred during the last Experiment update (either + # scheduling or promotion). + # Supports standard list paging. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload list_experiment_async_errors(request, options = nil) + # Pass arguments to `list_experiment_async_errors` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListExperimentAsyncErrorsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListExperimentAsyncErrorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_experiment_async_errors(resource_name: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_experiment_async_errors` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The name of the experiment from which to retrieve the async + # errors. + # @param page_token [::String] + # Token of the page to retrieve. If not specified, the first + # page of results will be returned. Use the value obtained from + # `next_page_token` in the previous response in order to request + # the next page of results. + # @param page_size [::Integer] + # Number of elements to retrieve in a single page. + # When a page request is too large, the server may decide to + # further limit the number of returned resources. + # The maximum page size is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Rpc::Status>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Rpc::Status>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListExperimentAsyncErrorsRequest.new + # + # # Call the list_experiment_async_errors method. + # result = client.list_experiment_async_errors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Rpc::Status. + # p item + # end + # + def list_experiment_async_errors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListExperimentAsyncErrorsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_experiment_async_errors.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_experiment_async_errors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_experiment_async_errors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiment_service_stub.call_rpc :list_experiment_async_errors, request, + options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @experiment_service_stub, :list_experiment_async_errors, + request, response, operation, options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Graduates an experiment to a full campaign. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ExperimentError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload graduate_experiment(request, options = nil) + # Pass arguments to `graduate_experiment` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GraduateExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GraduateExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload graduate_experiment(experiment: nil, campaign_budget_mappings: nil, validate_only: nil) + # Pass arguments to `graduate_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param experiment [::String] + # Required. The experiment to be graduated. + # @param campaign_budget_mappings [::Array<::Google::Ads::GoogleAds::V16::Services::CampaignBudgetMapping, ::Hash>] + # Required. List of campaign budget mappings for graduation. Each campaign + # that appears here will graduate, and will be assigned a new budget that is + # paired with it in the mapping. The maximum size is one. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GraduateExperimentRequest.new + # + # # Call the graduate_experiment method. + # result = client.graduate_experiment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def graduate_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GraduateExperimentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.graduate_experiment.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.experiment + header_params["experiment"] = request.experiment + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.graduate_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.graduate_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiment_service_stub.call_rpc :graduate_experiment, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Schedule an experiment. The in design campaign + # will be converted into a real campaign (called the experiment campaign) + # that will begin serving ads if successfully created. + # + # The experiment is scheduled immediately with status INITIALIZING. + # This method returns a long running operation that tracks the forking of the + # in design campaign. If the forking fails, a list of errors can be retrieved + # using the ListExperimentAsyncErrors method. The operation's + # metadata will be a string containing the resource name of the created + # experiment. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ExperimentError]() + # [DatabaseError]() + # [DateError]() + # [DateRangeError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # + # @overload schedule_experiment(request, options = nil) + # Pass arguments to `schedule_experiment` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ScheduleExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ScheduleExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload schedule_experiment(resource_name: nil, validate_only: nil) + # Pass arguments to `schedule_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The scheduled experiment. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ScheduleExperimentRequest.new + # + # # Call the schedule_experiment method. + # result = client.schedule_experiment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def schedule_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ScheduleExperimentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.schedule_experiment.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.schedule_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.schedule_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiment_service_stub.call_rpc :schedule_experiment, request, + options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Promotes the trial campaign thus applying changes in the trial campaign + # to the base campaign. + # This method returns a long running operation that tracks the promotion of + # the experiment campaign. If it fails, a list of errors can be retrieved + # using the ListExperimentAsyncErrors method. The operation's + # metadata will be a string containing the resource name of the created + # experiment. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ExperimentError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload promote_experiment(request, options = nil) + # Pass arguments to `promote_experiment` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::PromoteExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::PromoteExperimentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload promote_experiment(resource_name: nil, validate_only: nil) + # Pass arguments to `promote_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The resource name of the experiment to promote. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::PromoteExperimentRequest.new + # + # # Call the promote_experiment method. + # result = client.promote_experiment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def promote_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::PromoteExperimentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.promote_experiment.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.promote_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.promote_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @experiment_service_stub.call_rpc :promote_experiment, request, + options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ExperimentService API. + # + # This class represents the configuration for ExperimentService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_experiments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_experiments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ExperimentService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_experiments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ExperimentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_experiments` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_experiments + ## + # RPC-specific configuration for `end_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :end_experiment + ## + # RPC-specific configuration for `list_experiment_async_errors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_experiment_async_errors + ## + # RPC-specific configuration for `graduate_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :graduate_experiment + ## + # RPC-specific configuration for `schedule_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :schedule_experiment + ## + # RPC-specific configuration for `promote_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :promote_experiment + + # @private + def initialize parent_rpcs = nil + mutate_experiments_config = parent_rpcs.mutate_experiments if parent_rpcs.respond_to? :mutate_experiments + @mutate_experiments = ::Gapic::Config::Method.new mutate_experiments_config + end_experiment_config = parent_rpcs.end_experiment if parent_rpcs.respond_to? :end_experiment + @end_experiment = ::Gapic::Config::Method.new end_experiment_config + list_experiment_async_errors_config = parent_rpcs.list_experiment_async_errors if parent_rpcs.respond_to? :list_experiment_async_errors + @list_experiment_async_errors = ::Gapic::Config::Method.new list_experiment_async_errors_config + graduate_experiment_config = parent_rpcs.graduate_experiment if parent_rpcs.respond_to? :graduate_experiment + @graduate_experiment = ::Gapic::Config::Method.new graduate_experiment_config + schedule_experiment_config = parent_rpcs.schedule_experiment if parent_rpcs.respond_to? :schedule_experiment + @schedule_experiment = ::Gapic::Config::Method.new schedule_experiment_config + promote_experiment_config = parent_rpcs.promote_experiment if parent_rpcs.respond_to? :promote_experiment + @promote_experiment = ::Gapic::Config::Method.new promote_experiment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_service/credentials.rb b/lib/google/ads/google_ads/v16/services/experiment_service/credentials.rb new file mode 100644 index 000000000..f11e34f93 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExperimentService + # Credentials for the ExperimentService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_service/operations.rb b/lib/google/ads/google_ads/v16/services/experiment_service/operations.rb new file mode 100644 index 000000000..639114df5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_service/operations.rb @@ -0,0 +1,813 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExperimentService + # Service that implements Longrunning Operations API. + class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ExperimentService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ExperimentService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, + operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_service/paths.rb b/lib/google/ads/google_ads/v16/services/experiment_service/paths.rb new file mode 100644 index 000000000..c8b884823 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_service/paths.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExperimentService + # Path helper methods for the ExperimentService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignBudget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBudgets/{campaign_budget_id}` + # + # @param customer_id [String] + # @param campaign_budget_id [String] + # + # @return [::String] + def campaign_budget_path customer_id:, campaign_budget_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBudgets/#{campaign_budget_id}" + end + + ## + # Create a fully-qualified Experiment resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/experiments/{trial_id}` + # + # @param customer_id [String] + # @param trial_id [String] + # + # @return [::String] + def experiment_path customer_id:, trial_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/experiments/#{trial_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/experiment_service_pb.rb b/lib/google/ads/google_ads/v16/services/experiment_service_pb.rb new file mode 100644 index 000000000..7853a3387 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/experiment_service_pb.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/experiment_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/experiment_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/services/experiment_service.proto\x12!google.ads.googleads.v16.services\x1a\x33google/ads/googleads/v16/resources/experiment.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb5\x01\n\x18MutateExperimentsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12O\n\noperations\x18\x02 \x03(\x0b\x32\x36.google.ads.googleads.v16.services.ExperimentOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x93\x02\n\x13\x45xperimentOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12@\n\x06\x63reate\x18\x01 \x01(\x0b\x32..google.ads.googleads.v16.resources.ExperimentH\x00\x12@\n\x06update\x18\x02 \x01(\x0b\x32..google.ads.googleads.v16.resources.ExperimentH\x00\x12:\n\x06remove\x18\x03 \x01(\tB(\xfa\x41%\n#googleads.googleapis.com/ExperimentH\x00\x42\x0b\n\toperation\"\x9a\x01\n\x19MutateExperimentsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12J\n\x07results\x18\x02 \x03(\x0b\x32\x39.google.ads.googleads.v16.services.MutateExperimentResult\"Y\n\x16MutateExperimentResult\x12?\n\rresource_name\x18\x01 \x01(\tB(\xfa\x41%\n#googleads.googleapis.com/Experiment\"n\n\x14\x45ndExperimentRequest\x12?\n\nexperiment\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#googleads.googleapis.com/Experiment\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\"\x8d\x01\n ListExperimentAsyncErrorsRequest\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#googleads.googleapis.com/Experiment\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"`\n!ListExperimentAsyncErrorsResponse\x12\"\n\x06\x65rrors\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd4\x01\n\x19GraduateExperimentRequest\x12?\n\nexperiment\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#googleads.googleapis.com/Experiment\x12_\n\x18\x63\x61mpaign_budget_mappings\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.CampaignBudgetMappingB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa9\x01\n\x15\x43\x61mpaignBudgetMapping\x12\x46\n\x13\x65xperiment_campaign\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!googleads.googleapis.com/Campaign\x12H\n\x0f\x63\x61mpaign_budget\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'googleads.googleapis.com/CampaignBudget\"v\n\x19ScheduleExperimentRequest\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#googleads.googleapis.com/Experiment\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\"]\n\x1aScheduleExperimentMetadata\x12?\n\nexperiment\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#googleads.googleapis.com/Experiment\"u\n\x18PromoteExperimentRequest\x12\x42\n\rresource_name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#googleads.googleapis.com/Experiment\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\"\\\n\x19PromoteExperimentMetadata\x12?\n\nexperiment\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#googleads.googleapis.com/Experiment2\xb3\x0c\n\x11\x45xperimentService\x12\xe5\x01\n\x11MutateExperiments\x12;.google.ads.googleads.v16.services.MutateExperimentsRequest\x1a<.google.ads.googleads.v16.services.MutateExperimentsResponse\"U\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x36\"1/v16/customers/{customer_id=*}/experiments:mutate:\x01*\x12\xb3\x01\n\rEndExperiment\x12\x37.google.ads.googleads.v16.services.EndExperimentRequest\x1a\x16.google.protobuf.Empty\"Q\xda\x41\nexperiment\x82\xd3\xe4\x93\x02>\"9/v16/{experiment=customers/*/experiments/*}:endExperiment:\x01*\x12\x88\x02\n\x19ListExperimentAsyncErrors\x12\x43.google.ads.googleads.v16.services.ListExperimentAsyncErrorsRequest\x1a\x44.google.ads.googleads.v16.services.ListExperimentAsyncErrorsResponse\"`\xda\x41\rresource_name\x82\xd3\xe4\x93\x02J\x12H/v16/{resource_name=customers/*/experiments/*}:listExperimentAsyncErrors\x12\xdb\x01\n\x12GraduateExperiment\x12<.google.ads.googleads.v16.services.GraduateExperimentRequest\x1a\x16.google.protobuf.Empty\"o\xda\x41#experiment,campaign_budget_mappings\x82\xd3\xe4\x93\x02\x43\">/v16/{experiment=customers/*/experiments/*}:graduateExperiment:\x01*\x12\xa8\x02\n\x12ScheduleExperiment\x12<.google.ads.googleads.v16.services.ScheduleExperimentRequest\x1a\x1d.google.longrunning.Operation\"\xb4\x01\xca\x41U\n\x15google.protobuf.Empty\x12] + # Required. The list of operations to perform on individual extension feed + # items. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateExtensionFeedItemsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateExtensionFeedItemsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ExtensionFeedItemService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateExtensionFeedItemsRequest.new + # + # # Call the mutate_extension_feed_items method. + # result = client.mutate_extension_feed_items request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateExtensionFeedItemsResponse. + # p result + # + def mutate_extension_feed_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateExtensionFeedItemsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_extension_feed_items.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_extension_feed_items.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_extension_feed_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @extension_feed_item_service_stub.call_rpc :mutate_extension_feed_items, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ExtensionFeedItemService API. + # + # This class represents the configuration for ExtensionFeedItemService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ExtensionFeedItemService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_extension_feed_items to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ExtensionFeedItemService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_extension_feed_items.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ExtensionFeedItemService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_extension_feed_items.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ExtensionFeedItemService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_extension_feed_items` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_extension_feed_items + + # @private + def initialize parent_rpcs = nil + mutate_extension_feed_items_config = parent_rpcs.mutate_extension_feed_items if parent_rpcs.respond_to? :mutate_extension_feed_items + @mutate_extension_feed_items = ::Gapic::Config::Method.new mutate_extension_feed_items_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/extension_feed_item_service/credentials.rb b/lib/google/ads/google_ads/v16/services/extension_feed_item_service/credentials.rb new file mode 100644 index 000000000..913c0e3be --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/extension_feed_item_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExtensionFeedItemService + # Credentials for the ExtensionFeedItemService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/extension_feed_item_service/paths.rb b/lib/google/ads/google_ads/v16/services/extension_feed_item_service/paths.rb new file mode 100644 index 000000000..13c207a35 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/extension_feed_item_service/paths.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ExtensionFeedItemService + # Path helper methods for the ExtensionFeedItemService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified ExtensionFeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/extensionFeedItems/{feed_item_id}` + # + # @param customer_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def extension_feed_item_path customer_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/extensionFeedItems/#{feed_item_id}" + end + + ## + # Create a fully-qualified GeoTargetConstant resource string. + # + # The resource will be in the following format: + # + # `geoTargetConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def geo_target_constant_path criterion_id: + "geoTargetConstants/#{criterion_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/extension_feed_item_service_pb.rb b/lib/google/ads/google_ads/v16/services/extension_feed_item_service_pb.rb new file mode 100644 index 000000000..fe7d4266b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/extension_feed_item_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/extension_feed_item_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/extension_feed_item_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/services/extension_feed_item_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a] + # Required. The list of operations to perform on individual feed items. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::FeedItemService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateFeedItemsRequest.new + # + # # Call the mutate_feed_items method. + # result = client.mutate_feed_items request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateFeedItemsResponse. + # p result + # + def mutate_feed_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_feed_items.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_feed_items.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_feed_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feed_item_service_stub.call_rpc :mutate_feed_items, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the FeedItemService API. + # + # This class represents the configuration for FeedItemService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::FeedItemService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_feed_items to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::FeedItemService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_items.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_items.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeedItemService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_feed_items` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_feed_items + + # @private + def initialize parent_rpcs = nil + mutate_feed_items_config = parent_rpcs.mutate_feed_items if parent_rpcs.respond_to? :mutate_feed_items + @mutate_feed_items = ::Gapic::Config::Method.new mutate_feed_items_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_service/credentials.rb b/lib/google/ads/google_ads/v16/services/feed_item_service/credentials.rb new file mode 100644 index 000000000..f499c6ac8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemService + # Credentials for the FeedItemService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_service/paths.rb b/lib/google/ads/google_ads/v16/services/feed_item_service/paths.rb new file mode 100644 index 000000000..e209f4f04 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemService + # Path helper methods for the FeedItemService API. + module Paths + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + ## + # Create a fully-qualified FeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def feed_item_path customer_id:, feed_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItems/#{feed_id}~#{feed_item_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_service_pb.rb b/lib/google/ads/google_ads/v16/services/feed_item_service_pb.rb new file mode 100644 index 000000000..e6d3e1aac --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/feed_item_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/feed_item_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/services/feed_item_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x32google/ads/googleads/v16/resources/feed_item.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x9d\x02\n\x16MutateFeedItemsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12M\n\noperations\x18\x02 \x03(\x0b\x32\x34.google.ads.googleads.v16.services.FeedItemOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x8b\x02\n\x11\x46\x65\x65\x64ItemOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12>\n\x06\x63reate\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.FeedItemH\x00\x12>\n\x06update\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.FeedItemH\x00\x12\x38\n\x06remove\x18\x03 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/FeedItemH\x00\x42\x0b\n\toperation\"\x96\x01\n\x17MutateFeedItemsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12H\n\x07results\x18\x02 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.MutateFeedItemResult\"\x96\x01\n\x14MutateFeedItemResult\x12=\n\rresource_name\x18\x01 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/FeedItem\x12?\n\tfeed_item\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.FeedItem2\xb8\x02\n\x0f\x46\x65\x65\x64ItemService\x12\xdd\x01\n\x0fMutateFeedItems\x12\x39.google.ads.googleads.v16.services.MutateFeedItemsRequest\x1a:.google.ads.googleads.v16.services.MutateFeedItemsResponse\"S\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x34\"//v16/customers/{customer_id=*}/feedItems:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x80\x02\n%com.google.ads.googleads.v16.servicesB\x14\x46\x65\x65\x64ItemServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.FeedItem", "google/ads/googleads/v16/resources/feed_item.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateFeedItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemsRequest").msgclass + FeedItemOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.FeedItemOperation").msgclass + MutateFeedItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemsResponse").msgclass + MutateFeedItemResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/feed_item_service_services_pb.rb new file mode 100644 index 000000000..07cd252bc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_service_services_pb.rb @@ -0,0 +1,77 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/feed_item_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/feed_item_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemService + # Proto file describing the FeedItem service. + # + # Service to manage feed items. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.FeedItemService' + + # Creates, updates, or removes feed items. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [CriterionError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FeedItemError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + rpc :MutateFeedItems, ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_link_service.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service.rb new file mode 100644 index 000000000..95e98c22c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/feed_item_set_link_service/credentials" +require "google/ads/google_ads/v16/services/feed_item_set_link_service/paths" +require "google/ads/google_ads/v16/services/feed_item_set_link_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage feed item set links. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/feed_item_set_link_service" + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client.new + # + module FeedItemSetLinkService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "feed_item_set_link_service", "helpers.rb" +require "google/ads/google_ads/v16/services/feed_item_set_link_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/client.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/client.rb new file mode 100644 index 000000000..1df61930f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/client.rb @@ -0,0 +1,444 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/feed_item_set_link_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemSetLinkService + ## + # Client for the FeedItemSetLinkService service. + # + # Service to manage feed item set links. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feed_item_set_link_service_stub + + ## + # Configure the FeedItemSetLinkService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeedItemSetLinkService clients + # ::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the FeedItemSetLinkService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @feed_item_set_link_service_stub.universe_domain + end + + ## + # Create a new FeedItemSetLinkService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeedItemSetLinkService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/feed_item_set_link_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @feed_item_set_link_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes feed item set links. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_feed_item_set_links(request, options = nil) + # Pass arguments to `mutate_feed_item_set_links` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_feed_item_set_links(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_feed_item_set_links` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose feed item set links are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkOperation, ::Hash>] + # Required. The list of operations to perform on individual feed item set + # links. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksRequest.new + # + # # Call the mutate_feed_item_set_links method. + # result = client.mutate_feed_item_set_links request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksResponse. + # p result + # + def mutate_feed_item_set_links request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_feed_item_set_links.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_feed_item_set_links.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_feed_item_set_links.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feed_item_set_link_service_stub.call_rpc :mutate_feed_item_set_links, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the FeedItemSetLinkService API. + # + # This class represents the configuration for FeedItemSetLinkService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_feed_item_set_links to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_item_set_links.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemSetLinkService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_item_set_links.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeedItemSetLinkService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_feed_item_set_links` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_feed_item_set_links + + # @private + def initialize parent_rpcs = nil + mutate_feed_item_set_links_config = parent_rpcs.mutate_feed_item_set_links if parent_rpcs.respond_to? :mutate_feed_item_set_links + @mutate_feed_item_set_links = ::Gapic::Config::Method.new mutate_feed_item_set_links_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/credentials.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/credentials.rb new file mode 100644 index 000000000..57548fae9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemSetLinkService + # Credentials for the FeedItemSetLinkService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/paths.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/paths.rb new file mode 100644 index 000000000..93785d19a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service/paths.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemSetLinkService + # Path helper methods for the FeedItemSetLinkService API. + module Paths + ## + # Create a fully-qualified FeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def feed_item_path customer_id:, feed_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItems/#{feed_id}~#{feed_item_id}" + end + + ## + # Create a fully-qualified FeedItemSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemSets/{feed_id}~{feed_item_set_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_set_id [String] + # + # @return [::String] + def feed_item_set_path customer_id:, feed_id:, feed_item_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItemSets/#{feed_id}~#{feed_item_set_id}" + end + + ## + # Create a fully-qualified FeedItemSetLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemSetLinks/{feed_id}~{feed_item_set_id}~{feed_item_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_set_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def feed_item_set_link_path customer_id:, feed_id:, feed_item_set_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + raise ::ArgumentError, "feed_item_set_id cannot contain /" if feed_item_set_id.to_s.include? "/" + + "customers/#{customer_id}/feedItemSetLinks/#{feed_id}~#{feed_item_set_id}~#{feed_item_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_link_service_pb.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service_pb.rb new file mode 100644 index 000000000..a466c6398 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/feed_item_set_link_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/feed_item_set_link_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/services/feed_item_set_link_service.proto\x12!google.ads.googleads.v16.services\x1a;google/ads/googleads/v16/resources/feed_item_set_link.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xbf\x01\n\x1dMutateFeedItemSetLinksRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12T\n\noperations\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.FeedItemSetLinkOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xaf\x01\n\x18\x46\x65\x65\x64ItemSetLinkOperation\x12\x45\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.FeedItemSetLinkH\x00\x12?\n\x06remove\x18\x02 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/FeedItemSetLinkH\x00\x42\x0b\n\toperation\"\xa4\x01\n\x1eMutateFeedItemSetLinksResponse\x12O\n\x07results\x18\x01 \x03(\x0b\x32>.google.ads.googleads.v16.services.MutateFeedItemSetLinkResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"c\n\x1bMutateFeedItemSetLinkResult\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/FeedItemSetLink2\xdb\x02\n\x16\x46\x65\x65\x64ItemSetLinkService\x12\xf9\x01\n\x16MutateFeedItemSetLinks\x12@.google.ads.googleads.v16.services.MutateFeedItemSetLinksRequest\x1a\x41.google.ads.googleads.v16.services.MutateFeedItemSetLinksResponse\"Z\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02;\"6/v16/customers/{customer_id=*}/feedItemSetLinks:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x87\x02\n%com.google.ads.googleads.v16.servicesB\x1b\x46\x65\x65\x64ItemSetLinkServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.FeedItemSetLink", "google/ads/googleads/v16/resources/feed_item_set_link.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateFeedItemSetLinksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemSetLinksRequest").msgclass + FeedItemSetLinkOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.FeedItemSetLinkOperation").msgclass + MutateFeedItemSetLinksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemSetLinksResponse").msgclass + MutateFeedItemSetLinkResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemSetLinkResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_link_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service_services_pb.rb new file mode 100644 index 000000000..75ec23594 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_link_service_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/feed_item_set_link_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/feed_item_set_link_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemSetLinkService + # Proto file describing the FeedItemSetLink service. + # + # Service to manage feed item set links. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.FeedItemSetLinkService' + + # Creates, updates, or removes feed item set links. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateFeedItemSetLinks, ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksRequest, ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetLinksResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_service.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_service.rb new file mode 100644 index 000000000..d3ad8644b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/feed_item_set_service/credentials" +require "google/ads/google_ads/v16/services/feed_item_set_service/paths" +require "google/ads/google_ads/v16/services/feed_item_set_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage feed Item Set + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/feed_item_set_service" + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client.new + # + module FeedItemSetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "feed_item_set_service", "helpers.rb" +require "google/ads/google_ads/v16/services/feed_item_set_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_service/client.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_service/client.rb new file mode 100644 index 000000000..81655f8cc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_service/client.rb @@ -0,0 +1,444 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/feed_item_set_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemSetService + ## + # Client for the FeedItemSetService service. + # + # Service to manage feed Item Set + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feed_item_set_service_stub + + ## + # Configure the FeedItemSetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeedItemSetService clients + # ::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the FeedItemSetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @feed_item_set_service_stub.universe_domain + end + + ## + # Create a new FeedItemSetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeedItemSetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/feed_item_set_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @feed_item_set_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates or removes feed item sets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_feed_item_sets(request, options = nil) + # Pass arguments to `mutate_feed_item_sets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_feed_item_sets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_feed_item_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose feed item sets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::FeedItemSetOperation, ::Hash>] + # Required. The list of operations to perform on individual feed item sets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsRequest.new + # + # # Call the mutate_feed_item_sets method. + # result = client.mutate_feed_item_sets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsResponse. + # p result + # + def mutate_feed_item_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_feed_item_sets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_feed_item_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_feed_item_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feed_item_set_service_stub.call_rpc :mutate_feed_item_sets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the FeedItemSetService API. + # + # This class represents the configuration for FeedItemSetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_feed_item_sets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_item_sets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemSetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_item_sets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeedItemSetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_feed_item_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_feed_item_sets + + # @private + def initialize parent_rpcs = nil + mutate_feed_item_sets_config = parent_rpcs.mutate_feed_item_sets if parent_rpcs.respond_to? :mutate_feed_item_sets + @mutate_feed_item_sets = ::Gapic::Config::Method.new mutate_feed_item_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_service/credentials.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_service/credentials.rb new file mode 100644 index 000000000..a72be46ac --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemSetService + # Credentials for the FeedItemSetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_service/paths.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_service/paths.rb new file mode 100644 index 000000000..976d8bd70 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemSetService + # Path helper methods for the FeedItemSetService API. + module Paths + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + ## + # Create a fully-qualified FeedItemSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemSets/{feed_id}~{feed_item_set_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_set_id [String] + # + # @return [::String] + def feed_item_set_path customer_id:, feed_id:, feed_item_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItemSets/#{feed_id}~#{feed_item_set_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_service_pb.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_service_pb.rb new file mode 100644 index 000000000..6dbf46d78 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/feed_item_set_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/feed_item_set_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n=google/ads/googleads/v16/services/feed_item_set_service.proto\x12!google.ads.googleads.v16.services\x1a\x36google/ads/googleads/v16/resources/feed_item_set.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb7\x01\n\x19MutateFeedItemSetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12P\n\noperations\x18\x02 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.FeedItemSetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x97\x02\n\x14\x46\x65\x65\x64ItemSetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x41\n\x06\x63reate\x18\x01 \x01(\x0b\x32/.google.ads.googleads.v16.resources.FeedItemSetH\x00\x12\x41\n\x06update\x18\x02 \x01(\x0b\x32/.google.ads.googleads.v16.resources.FeedItemSetH\x00\x12;\n\x06remove\x18\x03 \x01(\tB)\xfa\x41&\n$googleads.googleapis.com/FeedItemSetH\x00\x42\x0b\n\toperation\"\x9c\x01\n\x1aMutateFeedItemSetsResponse\x12K\n\x07results\x18\x01 \x03(\x0b\x32:.google.ads.googleads.v16.services.MutateFeedItemSetResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"[\n\x17MutateFeedItemSetResult\x12@\n\rresource_name\x18\x01 \x01(\tB)\xfa\x41&\n$googleads.googleapis.com/FeedItemSet2\xc7\x02\n\x12\x46\x65\x65\x64ItemSetService\x12\xe9\x01\n\x12MutateFeedItemSets\x12<.google.ads.googleads.v16.services.MutateFeedItemSetsRequest\x1a=.google.ads.googleads.v16.services.MutateFeedItemSetsResponse\"V\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x37\"2/v16/customers/{customer_id=*}/feedItemSets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x83\x02\n%com.google.ads.googleads.v16.servicesB\x17\x46\x65\x65\x64ItemSetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.FeedItemSet", "google/ads/googleads/v16/resources/feed_item_set.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateFeedItemSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemSetsRequest").msgclass + FeedItemSetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.FeedItemSetOperation").msgclass + MutateFeedItemSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemSetsResponse").msgclass + MutateFeedItemSetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemSetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_set_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/feed_item_set_service_services_pb.rb new file mode 100644 index 000000000..5ff85cd53 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_set_service_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/feed_item_set_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/feed_item_set_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemSetService + # Proto file describing the FeedItemSet service. + # + # Service to manage feed Item Set + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.FeedItemSetService' + + # Creates, updates or removes feed item sets. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateFeedItemSets, ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemSetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_target_service.rb b/lib/google/ads/google_ads/v16/services/feed_item_target_service.rb new file mode 100644 index 000000000..70c6d7e49 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_target_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/feed_item_target_service/credentials" +require "google/ads/google_ads/v16/services/feed_item_target_service/paths" +require "google/ads/google_ads/v16/services/feed_item_target_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage feed item targets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/feed_item_target_service" + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client.new + # + module FeedItemTargetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "feed_item_target_service", "helpers.rb" +require "google/ads/google_ads/v16/services/feed_item_target_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/feed_item_target_service/client.rb b/lib/google/ads/google_ads/v16/services/feed_item_target_service/client.rb new file mode 100644 index 000000000..e9b1af98a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_target_service/client.rb @@ -0,0 +1,460 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/feed_item_target_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemTargetService + ## + # Client for the FeedItemTargetService service. + # + # Service to manage feed item targets. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feed_item_target_service_stub + + ## + # Configure the FeedItemTargetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeedItemTargetService clients + # ::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the FeedItemTargetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @feed_item_target_service_stub.universe_domain + end + + ## + # Create a new FeedItemTargetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeedItemTargetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/feed_item_target_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @feed_item_target_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or removes feed item targets. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CriterionError]() + # [DatabaseError]() + # [DistinctError]() + # [FeedItemTargetError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_feed_item_targets(request, options = nil) + # Pass arguments to `mutate_feed_item_targets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_feed_item_targets(customer_id: nil, operations: nil, partial_failure: nil, response_content_type: nil, validate_only: nil) + # Pass arguments to `mutate_feed_item_targets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose feed item targets are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::FeedItemTargetOperation, ::Hash>] + # Required. The list of operations to perform on individual feed item + # targets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsRequest.new + # + # # Call the mutate_feed_item_targets method. + # result = client.mutate_feed_item_targets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsResponse. + # p result + # + def mutate_feed_item_targets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_feed_item_targets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_feed_item_targets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_feed_item_targets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feed_item_target_service_stub.call_rpc :mutate_feed_item_targets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the FeedItemTargetService API. + # + # This class represents the configuration for FeedItemTargetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_feed_item_targets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_item_targets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::FeedItemTargetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_item_targets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeedItemTargetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_feed_item_targets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_feed_item_targets + + # @private + def initialize parent_rpcs = nil + mutate_feed_item_targets_config = parent_rpcs.mutate_feed_item_targets if parent_rpcs.respond_to? :mutate_feed_item_targets + @mutate_feed_item_targets = ::Gapic::Config::Method.new mutate_feed_item_targets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_target_service/credentials.rb b/lib/google/ads/google_ads/v16/services/feed_item_target_service/credentials.rb new file mode 100644 index 000000000..f8d1648b8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_target_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemTargetService + # Credentials for the FeedItemTargetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_target_service/paths.rb b/lib/google/ads/google_ads/v16/services/feed_item_target_service/paths.rb new file mode 100644 index 000000000..e9e795038 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_target_service/paths.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemTargetService + # Path helper methods for the FeedItemTargetService API. + module Paths + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified FeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def feed_item_path customer_id:, feed_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItems/#{feed_id}~#{feed_item_id}" + end + + ## + # Create a fully-qualified FeedItemTarget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemTargets/{feed_id}~{feed_item_id}~{feed_item_target_type}~{feed_item_target_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_id [String] + # @param feed_item_target_type [String] + # @param feed_item_target_id [String] + # + # @return [::String] + def feed_item_target_path customer_id:, feed_id:, feed_item_id:, feed_item_target_type:, + feed_item_target_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + raise ::ArgumentError, "feed_item_id cannot contain /" if feed_item_id.to_s.include? "/" + if feed_item_target_type.to_s.include? "/" + raise ::ArgumentError, + "feed_item_target_type cannot contain /" + end + + "customers/#{customer_id}/feedItemTargets/#{feed_id}~#{feed_item_id}~#{feed_item_target_type}~#{feed_item_target_id}" + end + + ## + # Create a fully-qualified GeoTargetConstant resource string. + # + # The resource will be in the following format: + # + # `geoTargetConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def geo_target_constant_path criterion_id: + "geoTargetConstants/#{criterion_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_target_service_pb.rb b/lib/google/ads/google_ads/v16/services/feed_item_target_service_pb.rb new file mode 100644 index 000000000..371db6a33 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_target_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/feed_item_target_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/feed_item_target_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n@google/ads/googleads/v16/services/feed_item_target_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x39google/ads/googleads/v16/resources/feed_item_target.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xa9\x02\n\x1cMutateFeedItemTargetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12S\n\noperations\x18\x02 \x03(\x0b\x32:.google.ads.googleads.v16.services.FeedItemTargetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xac\x01\n\x17\x46\x65\x65\x64ItemTargetOperation\x12\x44\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.FeedItemTargetH\x00\x12>\n\x06remove\x18\x02 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/FeedItemTargetH\x00\x42\x0b\n\toperation\"\xa2\x01\n\x1dMutateFeedItemTargetsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12N\n\x07results\x18\x02 \x03(\x0b\x32=.google.ads.googleads.v16.services.MutateFeedItemTargetResult\"\xaf\x01\n\x1aMutateFeedItemTargetResult\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/FeedItemTarget\x12L\n\x10\x66\x65\x65\x64_item_target\x18\x02 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.FeedItemTarget2\xd6\x02\n\x15\x46\x65\x65\x64ItemTargetService\x12\xf5\x01\n\x15MutateFeedItemTargets\x12?.google.ads.googleads.v16.services.MutateFeedItemTargetsRequest\x1a@.google.ads.googleads.v16.services.MutateFeedItemTargetsResponse\"Y\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}/feedItemTargets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x86\x02\n%com.google.ads.googleads.v16.servicesB\x1a\x46\x65\x65\x64ItemTargetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.FeedItemTarget", "google/ads/googleads/v16/resources/feed_item_target.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateFeedItemTargetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemTargetsRequest").msgclass + FeedItemTargetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.FeedItemTargetOperation").msgclass + MutateFeedItemTargetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemTargetsResponse").msgclass + MutateFeedItemTargetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedItemTargetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_item_target_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/feed_item_target_service_services_pb.rb new file mode 100644 index 000000000..4c2ac76d5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_item_target_service_services_pb.rb @@ -0,0 +1,70 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/feed_item_target_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/feed_item_target_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedItemTargetService + # Proto file describing the FeedItemTarget service. + # + # Service to manage feed item targets. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.FeedItemTargetService' + + # Creates or removes feed item targets. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CriterionError]() + # [DatabaseError]() + # [DistinctError]() + # [FeedItemTargetError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateFeedItemTargets, ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateFeedItemTargetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_mapping_service.rb b/lib/google/ads/google_ads/v16/services/feed_mapping_service.rb new file mode 100644 index 000000000..d0469bc2e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_mapping_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/feed_mapping_service/credentials" +require "google/ads/google_ads/v16/services/feed_mapping_service/paths" +require "google/ads/google_ads/v16/services/feed_mapping_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage feed mappings. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/feed_mapping_service" + # client = ::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client.new + # + module FeedMappingService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "feed_mapping_service", "helpers.rb" +require "google/ads/google_ads/v16/services/feed_mapping_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/feed_mapping_service/client.rb b/lib/google/ads/google_ads/v16/services/feed_mapping_service/client.rb new file mode 100644 index 000000000..7c23c06c3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_mapping_service/client.rb @@ -0,0 +1,459 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/feed_mapping_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedMappingService + ## + # Client for the FeedMappingService service. + # + # Service to manage feed mappings. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feed_mapping_service_stub + + ## + # Configure the FeedMappingService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeedMappingService clients + # ::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the FeedMappingService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @feed_mapping_service_stub.universe_domain + end + + ## + # Create a new FeedMappingService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeedMappingService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/feed_mapping_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @feed_mapping_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or removes feed mappings. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [DistinctError]() + # [FeedMappingError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [OperationAccessDeniedError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_feed_mappings(request, options = nil) + # Pass arguments to `mutate_feed_mappings` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateFeedMappingsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateFeedMappingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_feed_mappings(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_feed_mappings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose feed mappings are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::FeedMappingOperation, ::Hash>] + # Required. The list of operations to perform on individual feed mappings. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateFeedMappingsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateFeedMappingsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateFeedMappingsRequest.new + # + # # Call the mutate_feed_mappings method. + # result = client.mutate_feed_mappings request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateFeedMappingsResponse. + # p result + # + def mutate_feed_mappings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateFeedMappingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_feed_mappings.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_feed_mappings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_feed_mappings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feed_mapping_service_stub.call_rpc :mutate_feed_mappings, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the FeedMappingService API. + # + # This class represents the configuration for FeedMappingService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_feed_mappings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_mappings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::FeedMappingService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feed_mappings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeedMappingService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_feed_mappings` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_feed_mappings + + # @private + def initialize parent_rpcs = nil + mutate_feed_mappings_config = parent_rpcs.mutate_feed_mappings if parent_rpcs.respond_to? :mutate_feed_mappings + @mutate_feed_mappings = ::Gapic::Config::Method.new mutate_feed_mappings_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_mapping_service/credentials.rb b/lib/google/ads/google_ads/v16/services/feed_mapping_service/credentials.rb new file mode 100644 index 000000000..b1c8f718c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_mapping_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedMappingService + # Credentials for the FeedMappingService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_mapping_service/paths.rb b/lib/google/ads/google_ads/v16/services/feed_mapping_service/paths.rb new file mode 100644 index 000000000..e4a1a4afb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_mapping_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedMappingService + # Path helper methods for the FeedMappingService API. + module Paths + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + ## + # Create a fully-qualified FeedMapping resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedMappings/{feed_id}~{feed_mapping_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_mapping_id [String] + # + # @return [::String] + def feed_mapping_path customer_id:, feed_id:, feed_mapping_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedMappings/#{feed_id}~#{feed_mapping_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_mapping_service_pb.rb b/lib/google/ads/google_ads/v16/services/feed_mapping_service_pb.rb new file mode 100644 index 000000000..12a901a1f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_mapping_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/feed_mapping_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/feed_mapping_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n] + # Required. The list of operations to perform on individual feeds. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateFeedsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateFeedsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::FeedService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateFeedsRequest.new + # + # # Call the mutate_feeds method. + # result = client.mutate_feeds request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateFeedsResponse. + # p result + # + def mutate_feeds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateFeedsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_feeds.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_feeds.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_feeds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feed_service_stub.call_rpc :mutate_feeds, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the FeedService API. + # + # This class represents the configuration for FeedService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::FeedService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_feeds to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::FeedService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feeds.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::FeedService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_feeds.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeedService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_feeds` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_feeds + + # @private + def initialize parent_rpcs = nil + mutate_feeds_config = parent_rpcs.mutate_feeds if parent_rpcs.respond_to? :mutate_feeds + @mutate_feeds = ::Gapic::Config::Method.new mutate_feeds_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_service/credentials.rb b/lib/google/ads/google_ads/v16/services/feed_service/credentials.rb new file mode 100644 index 000000000..fcdf8e259 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedService + # Credentials for the FeedService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_service/paths.rb b/lib/google/ads/google_ads/v16/services/feed_service/paths.rb new file mode 100644 index 000000000..19b191b1e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedService + # Path helper methods for the FeedService API. + module Paths + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_service_pb.rb b/lib/google/ads/google_ads/v16/services/feed_service_pb.rb new file mode 100644 index 000000000..22fcc77f0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/feed_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/feed_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n4google/ads/googleads/v16/services/feed_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a-google/ads/googleads/v16/resources/feed.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x95\x02\n\x12MutateFeedsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12I\n\noperations\x18\x02 \x03(\x0b\x32\x30.google.ads.googleads.v16.services.FeedOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xfb\x01\n\rFeedOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12:\n\x06\x63reate\x18\x01 \x01(\x0b\x32(.google.ads.googleads.v16.resources.FeedH\x00\x12:\n\x06update\x18\x02 \x01(\x0b\x32(.google.ads.googleads.v16.resources.FeedH\x00\x12\x34\n\x06remove\x18\x03 \x01(\tB\"\xfa\x41\x1f\n\x1dgoogleads.googleapis.com/FeedH\x00\x42\x0b\n\toperation\"\x8e\x01\n\x13MutateFeedsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x44\n\x07results\x18\x02 \x03(\x0b\x32\x33.google.ads.googleads.v16.services.MutateFeedResult\"\x85\x01\n\x10MutateFeedResult\x12\x39\n\rresource_name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dgoogleads.googleapis.com/Feed\x12\x36\n\x04\x66\x65\x65\x64\x18\x02 \x01(\x0b\x32(.google.ads.googleads.v16.resources.Feed2\xa4\x02\n\x0b\x46\x65\x65\x64Service\x12\xcd\x01\n\x0bMutateFeeds\x12\x35.google.ads.googleads.v16.services.MutateFeedsRequest\x1a\x36.google.ads.googleads.v16.services.MutateFeedsResponse\"O\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x30\"+/v16/customers/{customer_id=*}/feeds:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\xfc\x01\n%com.google.ads.googleads.v16.servicesB\x10\x46\x65\x65\x64ServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.Feed", "google/ads/googleads/v16/resources/feed.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateFeedsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedsRequest").msgclass + FeedOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.FeedOperation").msgclass + MutateFeedsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedsResponse").msgclass + MutateFeedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateFeedResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/feed_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/feed_service_services_pb.rb new file mode 100644 index 000000000..b3f2668a2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/feed_service_services_pb.rb @@ -0,0 +1,76 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/feed_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/feed_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module FeedService + # Proto file describing the Feed service. + # + # Service to manage feeds. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.FeedService' + + # Creates, updates, or removes feeds. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DistinctError]() + # [FeedError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [ListOperationError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateFeeds, ::Google::Ads::GoogleAds::V16::Services::MutateFeedsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateFeedsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/geo_target_constant_service.rb b/lib/google/ads/google_ads/v16/services/geo_target_constant_service.rb new file mode 100644 index 000000000..88b86ef6a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/geo_target_constant_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/geo_target_constant_service/credentials" +require "google/ads/google_ads/v16/services/geo_target_constant_service/paths" +require "google/ads/google_ads/v16/services/geo_target_constant_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to fetch geo target constants. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/geo_target_constant_service" + # client = ::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client.new + # + module GeoTargetConstantService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "geo_target_constant_service", "helpers.rb" +require "google/ads/google_ads/v16/services/geo_target_constant_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/geo_target_constant_service/client.rb b/lib/google/ads/google_ads/v16/services/geo_target_constant_service/client.rb new file mode 100644 index 000000000..5f0c392a8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/geo_target_constant_service/client.rb @@ -0,0 +1,433 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/geo_target_constant_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GeoTargetConstantService + ## + # Client for the GeoTargetConstantService service. + # + # Service to fetch geo target constants. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :geo_target_constant_service_stub + + ## + # Configure the GeoTargetConstantService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GeoTargetConstantService clients + # ::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GeoTargetConstantService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @geo_target_constant_service_stub.universe_domain + end + + ## + # Create a new GeoTargetConstantService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GeoTargetConstantService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/geo_target_constant_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @geo_target_constant_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns GeoTargetConstant suggestions by location name or by resource name. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [GeoTargetConstantSuggestionError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload suggest_geo_target_constants(request, options = nil) + # Pass arguments to `suggest_geo_target_constants` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_geo_target_constants(locale: nil, country_code: nil, location_names: nil, geo_targets: nil) + # Pass arguments to `suggest_geo_target_constants` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param locale [::String] + # If possible, returned geo targets are translated using this locale. If not, + # en is used by default. This is also used as a hint for returned geo + # targets. + # @param country_code [::String] + # Returned geo targets are restricted to this country code. + # @param location_names [::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsRequest::LocationNames, ::Hash] + # The location names to search by. At most 25 names can be set. + # @param geo_targets [::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsRequest::GeoTargets, ::Hash] + # The geo target constant resource names to filter by. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsRequest.new + # + # # Call the suggest_geo_target_constants method. + # result = client.suggest_geo_target_constants request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsResponse. + # p result + # + def suggest_geo_target_constants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_geo_target_constants.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.suggest_geo_target_constants.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_geo_target_constants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @geo_target_constant_service_stub.call_rpc :suggest_geo_target_constants, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the GeoTargetConstantService API. + # + # This class represents the configuration for GeoTargetConstantService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # suggest_geo_target_constants to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_geo_target_constants.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::GeoTargetConstantService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_geo_target_constants.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the GeoTargetConstantService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `suggest_geo_target_constants` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_geo_target_constants + + # @private + def initialize parent_rpcs = nil + suggest_geo_target_constants_config = parent_rpcs.suggest_geo_target_constants if parent_rpcs.respond_to? :suggest_geo_target_constants + @suggest_geo_target_constants = ::Gapic::Config::Method.new suggest_geo_target_constants_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/geo_target_constant_service/credentials.rb b/lib/google/ads/google_ads/v16/services/geo_target_constant_service/credentials.rb new file mode 100644 index 000000000..9dc129b84 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/geo_target_constant_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GeoTargetConstantService + # Credentials for the GeoTargetConstantService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/geo_target_constant_service/paths.rb b/lib/google/ads/google_ads/v16/services/geo_target_constant_service/paths.rb new file mode 100644 index 000000000..f2b8274e0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/geo_target_constant_service/paths.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GeoTargetConstantService + # Path helper methods for the GeoTargetConstantService API. + module Paths + ## + # Create a fully-qualified GeoTargetConstant resource string. + # + # The resource will be in the following format: + # + # `geoTargetConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def geo_target_constant_path criterion_id: + "geoTargetConstants/#{criterion_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/geo_target_constant_service_pb.rb b/lib/google/ads/google_ads/v16/services/geo_target_constant_service_pb.rb new file mode 100644 index 000000000..911617aa9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/geo_target_constant_service_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/geo_target_constant_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/geo_target_constant_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' + + +descriptor_data = "\nCgoogle/ads/googleads/v16/services/geo_target_constant_service.proto\x12!google.ads.googleads.v16.services\x1a.google.ads.googleads.v16.services.GeoTargetConstantSuggestion\"\xb5\x02\n\x1bGeoTargetConstantSuggestion\x12\x13\n\x06locale\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05reach\x18\x07 \x01(\x03H\x01\x88\x01\x01\x12\x18\n\x0bsearch_term\x18\x08 \x01(\tH\x02\x88\x01\x01\x12R\n\x13geo_target_constant\x18\x04 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.GeoTargetConstant\x12Z\n\x1bgeo_target_constant_parents\x18\x05 \x03(\x0b\x32\x35.google.ads.googleads.v16.resources.GeoTargetConstantB\t\n\x07_localeB\x08\n\x06_reachB\x0e\n\x0c_search_term2\xb6\x02\n\x18GeoTargetConstantService\x12\xd2\x01\n\x19SuggestGeoTargetConstants\x12\x43.google.ads.googleads.v16.services.SuggestGeoTargetConstantsRequest\x1a\x44.google.ads.googleads.v16.services.SuggestGeoTargetConstantsResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/v16/geoTargetConstants:suggest:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x89\x02\n%com.google.ads.googleads.v16.servicesB\x1dGeoTargetConstantServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.GeoTargetConstant", "google/ads/googleads/v16/resources/geo_target_constant.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + SuggestGeoTargetConstantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestGeoTargetConstantsRequest").msgclass + SuggestGeoTargetConstantsRequest::LocationNames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestGeoTargetConstantsRequest.LocationNames").msgclass + SuggestGeoTargetConstantsRequest::GeoTargets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestGeoTargetConstantsRequest.GeoTargets").msgclass + SuggestGeoTargetConstantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestGeoTargetConstantsResponse").msgclass + GeoTargetConstantSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GeoTargetConstantSuggestion").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/geo_target_constant_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/geo_target_constant_service_services_pb.rb new file mode 100644 index 000000000..5bd0cdaa8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/geo_target_constant_service_services_pb.rb @@ -0,0 +1,58 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/geo_target_constant_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/geo_target_constant_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + 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.v16.services.GeoTargetConstantService' + + # Returns GeoTargetConstant suggestions by location name or by resource name. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [GeoTargetConstantSuggestionError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :SuggestGeoTargetConstants, ::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsRequest, ::Google::Ads::GoogleAds::V16::Services::SuggestGeoTargetConstantsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_field_service.rb b/lib/google/ads/google_ads/v16/services/google_ads_field_service.rb new file mode 100644 index 000000000..0c242bc03 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_field_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/google_ads_field_service/credentials" +require "google/ads/google_ads/v16/services/google_ads_field_service/paths" +require "google/ads/google_ads/v16/services/google_ads_field_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to fetch Google Ads API fields. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/google_ads_field_service" + # client = ::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client.new + # + module GoogleAdsFieldService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "google_ads_field_service", "helpers.rb" +require "google/ads/google_ads/v16/services/google_ads_field_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/google_ads_field_service/client.rb b/lib/google/ads/google_ads/v16/services/google_ads_field_service/client.rb new file mode 100644 index 000000000..1c2ba97c5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_field_service/client.rb @@ -0,0 +1,541 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/google_ads_field_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GoogleAdsFieldService + ## + # Client for the GoogleAdsFieldService service. + # + # Service to fetch Google Ads API fields. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :google_ads_field_service_stub + + ## + # Configure the GoogleAdsFieldService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GoogleAdsFieldService clients + # ::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GoogleAdsFieldService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @google_ads_field_service_stub.universe_domain + end + + ## + # Create a new GoogleAdsFieldService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GoogleAdsFieldService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/google_ads_field_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @google_ads_field_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns just the requested field. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload get_google_ads_field(request, options = nil) + # Pass arguments to `get_google_ads_field` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GetGoogleAdsFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GetGoogleAdsFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_google_ads_field(resource_name: nil) + # Pass arguments to `get_google_ads_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The resource name of the field to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Resources::GoogleAdsField] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Resources::GoogleAdsField] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GetGoogleAdsFieldRequest.new + # + # # Call the get_google_ads_field method. + # result = client.get_google_ads_field request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Resources::GoogleAdsField. + # p result + # + def get_google_ads_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GetGoogleAdsFieldRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_google_ads_field.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_google_ads_field.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_google_ads_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @google_ads_field_service_stub.call_rpc :get_google_ads_field, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns all fields that match the search query. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QueryError]() + # [QuotaError]() + # [RequestError]() + # + # @overload search_google_ads_fields(request, options = nil) + # Pass arguments to `search_google_ads_fields` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsFieldsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsFieldsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_google_ads_fields(query: nil, page_token: nil, page_size: nil) + # Pass arguments to `search_google_ads_fields` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param query [::String] + # Required. The query string. + # @param page_token [::String] + # Token of the page to retrieve. If not specified, the first page of + # results will be returned. Use the value obtained from `next_page_token` + # in the previous response in order to request the next page of results. + # @param page_size [::Integer] + # Number of elements to retrieve in a single page. + # When too large a page is requested, the server may decide to further + # limit the number of returned resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Ads::GoogleAds::V16::Resources::GoogleAdsField>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Ads::GoogleAds::V16::Resources::GoogleAdsField>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsFieldsRequest.new + # + # # Call the search_google_ads_fields method. + # result = client.search_google_ads_fields request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Ads::GoogleAds::V16::Resources::GoogleAdsField. + # p item + # end + # + def search_google_ads_fields request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsFieldsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.search_google_ads_fields.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_google_ads_fields.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_google_ads_fields.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @google_ads_field_service_stub.call_rpc :search_google_ads_fields, request, + options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @google_ads_field_service_stub, :search_google_ads_fields, + request, response, operation, options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the GoogleAdsFieldService API. + # + # This class represents the configuration for GoogleAdsFieldService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_google_ads_field to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_google_ads_field.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::GoogleAdsFieldService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_google_ads_field.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the GoogleAdsFieldService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_google_ads_field` + # @return [::Gapic::Config::Method] + # + attr_reader :get_google_ads_field + ## + # RPC-specific configuration for `search_google_ads_fields` + # @return [::Gapic::Config::Method] + # + attr_reader :search_google_ads_fields + + # @private + def initialize parent_rpcs = nil + get_google_ads_field_config = parent_rpcs.get_google_ads_field if parent_rpcs.respond_to? :get_google_ads_field + @get_google_ads_field = ::Gapic::Config::Method.new get_google_ads_field_config + search_google_ads_fields_config = parent_rpcs.search_google_ads_fields if parent_rpcs.respond_to? :search_google_ads_fields + @search_google_ads_fields = ::Gapic::Config::Method.new search_google_ads_fields_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_field_service/credentials.rb b/lib/google/ads/google_ads/v16/services/google_ads_field_service/credentials.rb new file mode 100644 index 000000000..929b5892c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_field_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GoogleAdsFieldService + # Credentials for the GoogleAdsFieldService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_field_service/paths.rb b/lib/google/ads/google_ads/v16/services/google_ads_field_service/paths.rb new file mode 100644 index 000000000..62ceb1f94 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_field_service/paths.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GoogleAdsFieldService + # Path helper methods for the GoogleAdsFieldService API. + module Paths + ## + # Create a fully-qualified GoogleAdsField resource string. + # + # The resource will be in the following format: + # + # `googleAdsFields/{google_ads_field}` + # + # @param google_ads_field [String] + # + # @return [::String] + def google_ads_field_path google_ads_field: + "googleAdsFields/#{google_ads_field}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_field_service_pb.rb b/lib/google/ads/google_ads/v16/services/google_ads_field_service_pb.rb new file mode 100644 index 000000000..fc59d7d56 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_field_service_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/google_ads_field_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/google_ads_field_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n@google/ads/googleads/v16/services/google_ads_field_service.proto\x12!google.ads.googleads.v16.services\x1a\x39google/ads/googleads/v16/resources/google_ads_field.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"b\n\x18GetGoogleAdsFieldRequest\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'googleads.googleapis.com/GoogleAdsField\"Y\n\x1cSearchGoogleAdsFieldsRequest\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x9a\x01\n\x1dSearchGoogleAdsFieldsResponse\x12\x43\n\x07results\x18\x01 \x03(\x0b\x32\x32.google.ads.googleads.v16.resources.GoogleAdsField\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x1b\n\x13total_results_count\x18\x03 \x01(\x03\x32\xf2\x03\n\x15GoogleAdsFieldService\x12\xc4\x01\n\x11GetGoogleAdsField\x12;.google.ads.googleads.v16.services.GetGoogleAdsFieldRequest\x1a\x32.google.ads.googleads.v16.resources.GoogleAdsField\">\xda\x41\rresource_name\x82\xd3\xe4\x93\x02(\x12&/v16/{resource_name=googleAdsFields/*}\x12\xca\x01\n\x15SearchGoogleAdsFields\x12?.google.ads.googleads.v16.services.SearchGoogleAdsFieldsRequest\x1a@.google.ads.googleads.v16.services.SearchGoogleAdsFieldsResponse\".\xda\x41\x05query\x82\xd3\xe4\x93\x02 \"\x1b/v16/googleAdsFields:search:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x86\x02\n%com.google.ads.googleads.v16.servicesB\x1aGoogleAdsFieldServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.GoogleAdsField", "google/ads/googleads/v16/resources/google_ads_field.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + GetGoogleAdsFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GetGoogleAdsFieldRequest").msgclass + SearchGoogleAdsFieldsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SearchGoogleAdsFieldsRequest").msgclass + SearchGoogleAdsFieldsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SearchGoogleAdsFieldsResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_field_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/google_ads_field_service_services_pb.rb new file mode 100644 index 000000000..ba5ddcc13 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_field_service_services_pb.rb @@ -0,0 +1,68 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/google_ads_field_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/google_ads_field_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GoogleAdsFieldService + # Proto file describing the GoogleAdsFieldService. + # + # Service to fetch Google Ads API fields. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.GoogleAdsFieldService' + + # Returns just the requested field. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :GetGoogleAdsField, ::Google::Ads::GoogleAds::V16::Services::GetGoogleAdsFieldRequest, ::Google::Ads::GoogleAds::V16::Resources::GoogleAdsField + # Returns all fields that match the search query. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QueryError]() + # [QuotaError]() + # [RequestError]() + rpc :SearchGoogleAdsFields, ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsFieldsRequest, ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsFieldsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_service.rb b/lib/google/ads/google_ads/v16/services/google_ads_service.rb new file mode 100644 index 000000000..1cbee89f9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/google_ads_service/credentials" +require "google/ads/google_ads/v16/services/google_ads_service/paths" +require "google/ads/google_ads/v16/services/google_ads_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to fetch data and metrics across resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/google_ads_service" + # client = ::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.new + # + module GoogleAdsService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "google_ads_service", "helpers.rb" +require "google/ads/google_ads/v16/services/google_ads_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/google_ads_service/client.rb b/lib/google/ads/google_ads/v16/services/google_ads_service/client.rb new file mode 100644 index 000000000..60d2fcbf6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_service/client.rb @@ -0,0 +1,795 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/google_ads_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GoogleAdsService + ## + # Client for the GoogleAdsService service. + # + # Service to fetch data and metrics across resources. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :google_ads_service_stub + + ## + # Configure the GoogleAdsService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GoogleAdsService clients + # ::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GoogleAdsService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @google_ads_service_stub.universe_domain + end + + ## + # Create a new GoogleAdsService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GoogleAdsService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/google_ads_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @google_ads_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns all rows that match the search query. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ChangeEventError]() + # [ChangeStatusError]() + # [ClickViewError]() + # [HeaderError]() + # [InternalError]() + # [QueryError]() + # [QuotaError]() + # [RequestError]() + # + # @overload search(request, options = nil) + # Pass arguments to `search` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search(customer_id: nil, query: nil, page_token: nil, page_size: nil, validate_only: nil, return_total_results_count: nil, summary_row_setting: nil) + # Pass arguments to `search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer being queried. + # @param query [::String] + # Required. The query string. + # @param page_token [::String] + # Token of the page to retrieve. If not specified, the first + # page of results will be returned. Use the value obtained from + # `next_page_token` in the previous response in order to request + # the next page of results. + # @param page_size [::Integer] + # Number of elements to retrieve in a single page. + # When too large a page is requested, the server may decide to + # further limit the number of returned resources. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. + # @param return_total_results_count [::Boolean] + # If true, the total number of results that match the query ignoring the + # LIMIT clause will be included in the response. + # Default is false. + # @param summary_row_setting [::Google::Ads::GoogleAds::V16::Enums::SummaryRowSettingEnum::SummaryRowSetting] + # Determines whether a summary row will be returned. By default, summary row + # is not returned. If requested, the summary row will be sent in a response + # by itself after all other query results are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Ads::GoogleAds::V16::Services::GoogleAdsRow>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Ads::GoogleAds::V16::Services::GoogleAdsRow>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsRequest.new + # + # # Call the search method. + # result = client.search request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Ads::GoogleAds::V16::Services::GoogleAdsRow. + # p item + # end + # + def search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.search.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.search.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @google_ads_service_stub.call_rpc :search, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @google_ads_service_stub, :search, request, response, + operation, options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns all rows that match the search stream query. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ChangeEventError]() + # [ChangeStatusError]() + # [ClickViewError]() + # [HeaderError]() + # [InternalError]() + # [QueryError]() + # [QuotaError]() + # [RequestError]() + # + # @overload search_stream(request, options = nil) + # Pass arguments to `search_stream` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_stream(customer_id: nil, query: nil, summary_row_setting: nil) + # Pass arguments to `search_stream` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer being queried. + # @param query [::String] + # Required. The query string. + # @param summary_row_setting [::Google::Ads::GoogleAds::V16::Enums::SummaryRowSettingEnum::SummaryRowSetting] + # Determines whether a summary row will be returned. By default, summary row + # is not returned. If requested, the summary row will be sent in a response + # by itself after all other query results are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamResponse>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamRequest.new + # + # # Call the search_stream method to start streaming. + # output = client.search_stream request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamResponse + # output.each do |current_response| + # p current_response + # end + # + def search_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.search_stream.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.search_stream.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @google_ads_service_stub.call_rpc :search_stream, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Creates, updates, or removes resources. This method supports atomic + # transactions with multiple types of resources. For example, you can + # atomically create a campaign and a campaign budget, or perform up to + # thousands of mutates atomically. + # + # This method is essentially a wrapper around a series of mutate methods. The + # only features it offers over calling those methods directly are: + # + # - Atomic transactions + # - Temp resource names (described below) + # - Somewhat reduced latency over making a series of mutate calls + # + # Note: Only resources that support atomic transactions are included, so this + # method can't replace all calls to individual services. + # + # ## Atomic Transaction Benefits + # + # Atomicity makes error handling much easier. If you're making a series of + # changes and one fails, it can leave your account in an inconsistent state. + # With atomicity, you either reach the chosen state directly, or the request + # fails and you can retry. + # + # ## Temp Resource Names + # + # Temp resource names are a special type of resource name used to create a + # resource and reference that resource in the same request. For example, if a + # campaign budget is created with `resource_name` equal to + # `customers/123/campaignBudgets/-1`, that resource name can be reused in + # the `Campaign.budget` field in the same request. That way, the two + # resources are created and linked atomically. + # + # To create a temp resource name, put a negative number in the part of the + # name that the server would normally allocate. + # + # Note: + # + # - Resources must be created with a temp name before the name can be reused. + # For example, the previous CampaignBudget+Campaign example would fail if + # the mutate order was reversed. + # - Temp names are not remembered across requests. + # - There's no limit to the number of temp names in a request. + # - Each temp name must use a unique negative number, even if the resource + # types differ. + # + # ## Latency + # + # It's important to group mutates by resource type or the request may time + # out and fail. Latency is roughly equal to a series of calls to individual + # mutate methods, where each change in resource type is a new call. For + # example, mutating 10 campaigns then 10 ad groups is like 2 calls, while + # mutating 1 campaign, 1 ad group, 1 campaign, 1 ad group is like 4 calls. + # + # List of thrown errors: + # [AdCustomizerError]() + # [AdError]() + # [AdGroupAdError]() + # [AdGroupCriterionError]() + # [AdGroupError]() + # [AssetError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [CampaignBudgetError]() + # [CampaignCriterionError]() + # [CampaignError]() + # [CampaignExperimentError]() + # [CampaignSharedSetError]() + # [CollectionSizeError]() + # [ContextError]() + # [ConversionActionError]() + # [CriterionError]() + # [CustomerFeedError]() + # [DatabaseError]() + # [DateError]() + # [DateRangeError]() + # [DistinctError]() + # [ExtensionFeedItemError]() + # [ExtensionSettingError]() + # [FeedAttributeReferenceError]() + # [FeedError]() + # [FeedItemError]() + # [FeedItemSetError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionParsingError]() + # [HeaderError]() + # [ImageError]() + # [InternalError]() + # [KeywordPlanAdGroupKeywordError]() + # [KeywordPlanCampaignError]() + # [KeywordPlanError]() + # [LabelError]() + # [ListOperationError]() + # [MediaUploadError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [PolicyFindingError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SettingError]() + # [SharedSetError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # [UserListError]() + # [YoutubeVideoRegistrationError]() + # + # @overload mutate(request, options = nil) + # Pass arguments to `mutate` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate(customer_id: nil, mutate_operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose resources are being modified. + # @param mutate_operations [::Array<::Google::Ads::GoogleAds::V16::Services::MutateOperation, ::Hash>] + # Required. The list of operations to perform on individual resources. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. The mutable + # resource will only be returned if the resource has the appropriate response + # field. For example, MutateCampaignResult.campaign. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsRequest.new + # + # # Call the mutate method. + # result = client.mutate request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsResponse. + # p result + # + def mutate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @google_ads_service_stub.call_rpc :mutate, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the GoogleAdsService API. + # + # This class represents the configuration for GoogleAdsService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # search to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the GoogleAdsService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `search` + # @return [::Gapic::Config::Method] + # + attr_reader :search + ## + # RPC-specific configuration for `search_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :search_stream + ## + # RPC-specific configuration for `mutate` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate + + # @private + def initialize parent_rpcs = nil + search_config = parent_rpcs.search if parent_rpcs.respond_to? :search + @search = ::Gapic::Config::Method.new search_config + search_stream_config = parent_rpcs.search_stream if parent_rpcs.respond_to? :search_stream + @search_stream = ::Gapic::Config::Method.new search_stream_config + mutate_config = parent_rpcs.mutate if parent_rpcs.respond_to? :mutate + @mutate = ::Gapic::Config::Method.new mutate_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_service/credentials.rb b/lib/google/ads/google_ads/v16/services/google_ads_service/credentials.rb new file mode 100644 index 000000000..cdf886b6a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GoogleAdsService + # Credentials for the GoogleAdsService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_service/paths.rb b/lib/google/ads/google_ads/v16/services/google_ads_service/paths.rb new file mode 100644 index 000000000..cc5f80be1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_service/paths.rb @@ -0,0 +1,3228 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GoogleAdsService + # Path helper methods for the GoogleAdsService API. + module Paths + ## + # Create a fully-qualified AccessibleBiddingStrategy resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accessibleBiddingStrategies/{bidding_strategy_id}` + # + # @param customer_id [String] + # @param bidding_strategy_id [String] + # + # @return [::String] + def accessible_bidding_strategy_path customer_id:, bidding_strategy_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accessibleBiddingStrategies/#{bidding_strategy_id}" + end + + ## + # Create a fully-qualified AccountBudget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accountBudgets/{account_budget_id}` + # + # @param customer_id [String] + # @param account_budget_id [String] + # + # @return [::String] + def account_budget_path customer_id:, account_budget_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accountBudgets/#{account_budget_id}" + end + + ## + # Create a fully-qualified AccountBudgetProposal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accountBudgetProposals/{account_budget_proposal_id}` + # + # @param customer_id [String] + # @param account_budget_proposal_id [String] + # + # @return [::String] + def account_budget_proposal_path customer_id:, account_budget_proposal_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accountBudgetProposals/#{account_budget_proposal_id}" + end + + ## + # Create a fully-qualified AccountLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/accountLinks/{account_link_id}` + # + # @param customer_id [String] + # @param account_link_id [String] + # + # @return [::String] + def account_link_path customer_id:, account_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/accountLinks/#{account_link_id}" + end + + ## + # Create a fully-qualified Ad resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/ads/{ad_id}` + # + # @param customer_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_path customer_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/ads/#{ad_id}" + end + + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified AdGroupAd resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAds/{ad_group_id}~{ad_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_group_ad_path customer_id:, ad_group_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAds/#{ad_group_id}~#{ad_id}" + end + + ## + # Create a fully-qualified AdGroupAdAssetCombinationView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAdAssetCombinationViews/{ad_group_id}~{ad_id}~{asset_combination_id_low}~{asset_combination_id_high}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # @param asset_combination_id_low [String] + # @param asset_combination_id_high [String] + # + # @return [::String] + def ad_group_ad_asset_combination_view_path customer_id:, ad_group_id:, ad_id:, + asset_combination_id_low:, asset_combination_id_high: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "ad_id cannot contain /" if ad_id.to_s.include? "/" + if asset_combination_id_low.to_s.include? "/" + raise ::ArgumentError, + "asset_combination_id_low cannot contain /" + end + + "customers/#{customer_id}/adGroupAdAssetCombinationViews/#{ad_group_id}~#{ad_id}~#{asset_combination_id_low}~#{asset_combination_id_high}" + end + + ## + # Create a fully-qualified AdGroupAdAssetView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAdAssetViews/{ad_group_id}~{ad_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def ad_group_ad_asset_view_path customer_id:, ad_group_id:, ad_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "ad_id cannot contain /" if ad_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAdAssetViews/#{ad_group_id}~#{ad_id}~#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified AdGroupAdLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAdLabels/{ad_group_id}~{ad_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param ad_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_ad_label_path customer_id:, ad_group_id:, ad_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "ad_id cannot contain /" if ad_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAdLabels/#{ad_group_id}~#{ad_id}~#{label_id}" + end + + ## + # Create a fully-qualified AdGroupAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAssets/{ad_group_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def ad_group_asset_path customer_id:, ad_group_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAssets/#{ad_group_id}~#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified AdGroupAssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAssetSets/{ad_group_id}~{asset_set_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def ad_group_asset_set_path customer_id:, ad_group_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAssetSets/#{ad_group_id}~#{asset_set_id}" + end + + ## + # Create a fully-qualified AdGroupAudienceView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupAudienceViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_audience_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupAudienceViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdGroupBidModifier resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupBidModifiers/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_bid_modifier_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupBidModifiers/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdGroupCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_group_criterion_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriteria/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AdGroupCriterionCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriterionCustomizers/{ad_group_id}~{criterion_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def ad_group_criterion_customizer_path customer_id:, ad_group_id:, criterion_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriterionCustomizers/#{ad_group_id}~#{criterion_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified AdGroupCriterionLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriterionLabels/{ad_group_id}~{criterion_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_criterion_label_path customer_id:, ad_group_id:, criterion_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriterionLabels/#{ad_group_id}~#{criterion_id}~#{label_id}" + end + + ## + # Create a fully-qualified AdGroupCriterionSimulation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCriterionSimulations/{ad_group_id}~{criterion_id}~{type}~{modification_method}~{start_date}~{end_date}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param type [String] + # @param modification_method [String] + # @param start_date [String] + # @param end_date [String] + # + # @return [::String] + def ad_group_criterion_simulation_path customer_id:, ad_group_id:, criterion_id:, type:, + modification_method:, start_date:, end_date: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + raise ::ArgumentError, "type cannot contain /" if type.to_s.include? "/" + raise ::ArgumentError, "modification_method cannot contain /" if modification_method.to_s.include? "/" + raise ::ArgumentError, "start_date cannot contain /" if start_date.to_s.include? "/" + + "customers/#{customer_id}/adGroupCriterionSimulations/#{ad_group_id}~#{criterion_id}~#{type}~#{modification_method}~#{start_date}~#{end_date}" + end + + ## + # Create a fully-qualified AdGroupCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupCustomizers/{ad_group_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def ad_group_customizer_path customer_id:, ad_group_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupCustomizers/#{ad_group_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified AdGroupExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupExtensionSettings/{ad_group_id}~{extension_type}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param extension_type [String] + # + # @return [::String] + def ad_group_extension_setting_path customer_id:, ad_group_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupExtensionSettings/#{ad_group_id}~#{extension_type}" + end + + ## + # Create a fully-qualified AdGroupFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupFeeds/{ad_group_id}~{feed_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param feed_id [String] + # + # @return [::String] + def ad_group_feed_path customer_id:, ad_group_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupFeeds/#{ad_group_id}~#{feed_id}" + end + + ## + # Create a fully-qualified AdGroupLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupLabels/{ad_group_id}~{label_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param label_id [String] + # + # @return [::String] + def ad_group_label_path customer_id:, ad_group_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/adGroupLabels/#{ad_group_id}~#{label_id}" + end + + ## + # Create a fully-qualified AdGroupSimulation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroupSimulations/{ad_group_id}~{type}~{modification_method}~{start_date}~{end_date}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param type [String] + # @param modification_method [String] + # @param start_date [String] + # @param end_date [String] + # + # @return [::String] + def ad_group_simulation_path customer_id:, ad_group_id:, type:, modification_method:, start_date:, + end_date: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "type cannot contain /" if type.to_s.include? "/" + raise ::ArgumentError, "modification_method cannot contain /" if modification_method.to_s.include? "/" + raise ::ArgumentError, "start_date cannot contain /" if start_date.to_s.include? "/" + + "customers/#{customer_id}/adGroupSimulations/#{ad_group_id}~#{type}~#{modification_method}~#{start_date}~#{end_date}" + end + + ## + # Create a fully-qualified AdParameter resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adParameters/{ad_group_id}~{criterion_id}~{parameter_index}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # @param parameter_index [String] + # + # @return [::String] + def ad_parameter_path customer_id:, ad_group_id:, criterion_id:, parameter_index: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + raise ::ArgumentError, "criterion_id cannot contain /" if criterion_id.to_s.include? "/" + + "customers/#{customer_id}/adParameters/#{ad_group_id}~#{criterion_id}~#{parameter_index}" + end + + ## + # Create a fully-qualified AdScheduleView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adScheduleViews/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def ad_schedule_view_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/adScheduleViews/#{campaign_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AgeRangeView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/ageRangeViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def age_range_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/ageRangeViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AndroidPrivacySharedKeyGoogleAdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/androidPrivacySharedKeyGoogleAdGroups/{campaign_id}~{ad_group_id}~{android_privacy_interaction_type}~{android_privacy_network_type}~{android_privacy_interaction_date}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param ad_group_id [String] + # @param android_privacy_interaction_type [String] + # @param android_privacy_network_type [String] + # @param android_privacy_interaction_date [String] + # + # @return [::String] + def android_privacy_shared_key_google_ad_group_path customer_id:, campaign_id:, ad_group_id:, + android_privacy_interaction_type:, android_privacy_network_type:, android_privacy_interaction_date: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + if android_privacy_interaction_type.to_s.include? "/" + raise ::ArgumentError, + "android_privacy_interaction_type cannot contain /" + end + if android_privacy_network_type.to_s.include? "/" + raise ::ArgumentError, + "android_privacy_network_type cannot contain /" + end + + "customers/#{customer_id}/androidPrivacySharedKeyGoogleAdGroups/#{campaign_id}~#{ad_group_id}~#{android_privacy_interaction_type}~#{android_privacy_network_type}~#{android_privacy_interaction_date}" + end + + ## + # Create a fully-qualified AndroidPrivacySharedKeyGoogleCampaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/androidPrivacySharedKeyGoogleCampaigns/{campaign_id}~{android_privacy_interaction_type}~{android_privacy_interaction_date}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param android_privacy_interaction_type [String] + # @param android_privacy_interaction_date [String] + # + # @return [::String] + def android_privacy_shared_key_google_campaign_path customer_id:, campaign_id:, + android_privacy_interaction_type:, android_privacy_interaction_date: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + if android_privacy_interaction_type.to_s.include? "/" + raise ::ArgumentError, + "android_privacy_interaction_type cannot contain /" + end + + "customers/#{customer_id}/androidPrivacySharedKeyGoogleCampaigns/#{campaign_id}~#{android_privacy_interaction_type}~#{android_privacy_interaction_date}" + end + + ## + # Create a fully-qualified AndroidPrivacySharedKeyGoogleNetworkType resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/androidPrivacySharedKeyGoogleNetworkTypes/{campaign_id}~{android_privacy_interaction_type}~{android_privacy_network_type}~{android_privacy_interaction_date}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param android_privacy_interaction_type [String] + # @param android_privacy_network_type [String] + # @param android_privacy_interaction_date [String] + # + # @return [::String] + def android_privacy_shared_key_google_network_type_path customer_id:, campaign_id:, + android_privacy_interaction_type:, android_privacy_network_type:, android_privacy_interaction_date: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + if android_privacy_interaction_type.to_s.include? "/" + raise ::ArgumentError, + "android_privacy_interaction_type cannot contain /" + end + if android_privacy_network_type.to_s.include? "/" + raise ::ArgumentError, + "android_privacy_network_type cannot contain /" + end + + "customers/#{customer_id}/androidPrivacySharedKeyGoogleNetworkTypes/#{campaign_id}~#{android_privacy_interaction_type}~#{android_privacy_network_type}~#{android_privacy_interaction_date}" + end + + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified AssetFieldTypeView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetFieldTypeViews/{field_type}` + # + # @param customer_id [String] + # @param field_type [String] + # + # @return [::String] + def asset_field_type_view_path customer_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetFieldTypeViews/#{field_type}" + end + + ## + # Create a fully-qualified AssetGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroups/{asset_group_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # + # @return [::String] + def asset_group_path customer_id:, asset_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroups/#{asset_group_id}" + end + + ## + # Create a fully-qualified AssetGroupAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupAssets/{asset_group_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def asset_group_asset_path customer_id:, asset_group_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupAssets/#{asset_group_id}~#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified AssetGroupListingGroupFilter resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupListingGroupFilters/{asset_group_id}~{listing_group_filter_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param listing_group_filter_id [String] + # + # @return [::String] + def asset_group_listing_group_filter_path customer_id:, asset_group_id:, listing_group_filter_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupListingGroupFilters/#{asset_group_id}~#{listing_group_filter_id}" + end + + ## + # Create a fully-qualified AssetGroupProductGroupView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupProductGroupViews/{asset_group_id}~{listing_group_filter_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param listing_group_filter_id [String] + # + # @return [::String] + def asset_group_product_group_view_path customer_id:, asset_group_id:, listing_group_filter_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupProductGroupViews/#{asset_group_id}~#{listing_group_filter_id}" + end + + ## + # Create a fully-qualified AssetGroupSignal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupSignals/{asset_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def asset_group_signal_path customer_id:, asset_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupSignals/#{asset_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified AssetGroupTopCombinationView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetGroupTopCombinationViews/{asset_group_id}~{asset_combination_category}` + # + # @param customer_id [String] + # @param asset_group_id [String] + # @param asset_combination_category [String] + # + # @return [::String] + def asset_group_top_combination_view_path customer_id:, asset_group_id:, asset_combination_category: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_group_id cannot contain /" if asset_group_id.to_s.include? "/" + + "customers/#{customer_id}/assetGroupTopCombinationViews/#{asset_group_id}~#{asset_combination_category}" + end + + ## + # Create a fully-qualified AssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSets/#{asset_set_id}" + end + + ## + # Create a fully-qualified AssetSetAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSetAssets/{asset_set_id}~{asset_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_set_asset_path customer_id:, asset_set_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_set_id cannot contain /" if asset_set_id.to_s.include? "/" + + "customers/#{customer_id}/assetSetAssets/#{asset_set_id}~#{asset_id}" + end + + ## + # Create a fully-qualified AssetSetTypeView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assetSetTypeViews/{asset_set_type}` + # + # @param customer_id [String] + # @param asset_set_type [String] + # + # @return [::String] + def asset_set_type_view_path customer_id:, asset_set_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assetSetTypeViews/#{asset_set_type}" + end + + ## + # Create a fully-qualified Audience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/audiences/{audience_id}` + # + # @param customer_id [String] + # @param audience_id [String] + # + # @return [::String] + def audience_path customer_id:, audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/audiences/#{audience_id}" + end + + ## + # Create a fully-qualified BatchJob resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/batchJobs/{batch_job_id}` + # + # @param customer_id [String] + # @param batch_job_id [String] + # + # @return [::String] + def batch_job_path customer_id:, batch_job_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/batchJobs/#{batch_job_id}" + end + + ## + # Create a fully-qualified BiddingDataExclusion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingDataExclusions/{seasonality_event_id}` + # + # @param customer_id [String] + # @param seasonality_event_id [String] + # + # @return [::String] + def bidding_data_exclusion_path customer_id:, seasonality_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingDataExclusions/#{seasonality_event_id}" + end + + ## + # Create a fully-qualified BiddingSeasonalityAdjustment resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingSeasonalityAdjustments/{seasonality_event_id}` + # + # @param customer_id [String] + # @param seasonality_event_id [String] + # + # @return [::String] + def bidding_seasonality_adjustment_path customer_id:, seasonality_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingSeasonalityAdjustments/#{seasonality_event_id}" + end + + ## + # Create a fully-qualified BiddingStrategy resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingStrategies/{bidding_strategy_id}` + # + # @param customer_id [String] + # @param bidding_strategy_id [String] + # + # @return [::String] + def bidding_strategy_path customer_id:, bidding_strategy_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/biddingStrategies/#{bidding_strategy_id}" + end + + ## + # Create a fully-qualified BiddingStrategySimulation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/biddingStrategySimulations/{bidding_strategy_id}~{type}~{modification_method}~{start_date}~{end_date}` + # + # @param customer_id [String] + # @param bidding_strategy_id [String] + # @param type [String] + # @param modification_method [String] + # @param start_date [String] + # @param end_date [String] + # + # @return [::String] + def bidding_strategy_simulation_path customer_id:, bidding_strategy_id:, type:, modification_method:, + start_date:, end_date: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "bidding_strategy_id cannot contain /" if bidding_strategy_id.to_s.include? "/" + raise ::ArgumentError, "type cannot contain /" if type.to_s.include? "/" + raise ::ArgumentError, "modification_method cannot contain /" if modification_method.to_s.include? "/" + raise ::ArgumentError, "start_date cannot contain /" if start_date.to_s.include? "/" + + "customers/#{customer_id}/biddingStrategySimulations/#{bidding_strategy_id}~#{type}~#{modification_method}~#{start_date}~#{end_date}" + end + + ## + # Create a fully-qualified BillingSetup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/billingSetups/{billing_setup_id}` + # + # @param customer_id [String] + # @param billing_setup_id [String] + # + # @return [::String] + def billing_setup_path customer_id:, billing_setup_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/billingSetups/#{billing_setup_id}" + end + + ## + # Create a fully-qualified CallView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/callViews/{call_detail_id}` + # + # @param customer_id [String] + # @param call_detail_id [String] + # + # @return [::String] + def call_view_path customer_id:, call_detail_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/callViews/#{call_detail_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def campaign_asset_path customer_id:, campaign_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/campaignAssets/#{campaign_id}~#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified CampaignAssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignAssetSets/{campaign_id}~{asset_set_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def campaign_asset_set_path customer_id:, campaign_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignAssetSets/#{campaign_id}~#{asset_set_id}" + end + + ## + # Create a fully-qualified CampaignAudienceView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignAudienceViews/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def campaign_audience_view_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignAudienceViews/#{campaign_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified CampaignBidModifier resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBidModifiers/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def campaign_bid_modifier_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBidModifiers/#{campaign_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified CampaignBudget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBudgets/{campaign_budget_id}` + # + # @param customer_id [String] + # @param campaign_budget_id [String] + # + # @return [::String] + def campaign_budget_path customer_id:, campaign_budget_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBudgets/#{campaign_budget_id}" + end + + ## + # Create a fully-qualified CampaignConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignConversionGoals/{campaign_id}~{category}~{source}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param category [String] + # @param source [String] + # + # @return [::String] + def campaign_conversion_goal_path customer_id:, campaign_id:, category:, source: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "category cannot contain /" if category.to_s.include? "/" + + "customers/#{customer_id}/campaignConversionGoals/#{campaign_id}~#{category}~#{source}" + end + + ## + # Create a fully-qualified CampaignCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignCriteria/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def campaign_criterion_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignCriteria/#{campaign_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified CampaignCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignCustomizers/{campaign_id}~{customizer_attribute_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def campaign_customizer_path customer_id:, campaign_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignCustomizers/#{campaign_id}~#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified CampaignDraft resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignDrafts/{base_campaign_id}~{draft_id}` + # + # @param customer_id [String] + # @param base_campaign_id [String] + # @param draft_id [String] + # + # @return [::String] + def campaign_draft_path customer_id:, base_campaign_id:, draft_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "base_campaign_id cannot contain /" if base_campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignDrafts/#{base_campaign_id}~#{draft_id}" + end + + ## + # Create a fully-qualified CampaignExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignExtensionSettings/{campaign_id}~{extension_type}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param extension_type [String] + # + # @return [::String] + def campaign_extension_setting_path customer_id:, campaign_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignExtensionSettings/#{campaign_id}~#{extension_type}" + end + + ## + # Create a fully-qualified CampaignFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignFeeds/{campaign_id}~{feed_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param feed_id [String] + # + # @return [::String] + def campaign_feed_path customer_id:, campaign_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignFeeds/#{campaign_id}~#{feed_id}" + end + + ## + # Create a fully-qualified CampaignGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignGroups/{campaign_group_id}` + # + # @param customer_id [String] + # @param campaign_group_id [String] + # + # @return [::String] + def campaign_group_path customer_id:, campaign_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignGroups/#{campaign_group_id}" + end + + ## + # Create a fully-qualified CampaignLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignLabels/{campaign_id}~{label_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param label_id [String] + # + # @return [::String] + def campaign_label_path customer_id:, campaign_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignLabels/#{campaign_id}~#{label_id}" + end + + ## + # Create a fully-qualified CampaignLifecycleGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignLifecycleGoals/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_lifecycle_goal_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignLifecycleGoals/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignSearchTermInsight resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignSearchTermInsights/{campaign_id}~{cluster_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param cluster_id [String] + # + # @return [::String] + def campaign_search_term_insight_path customer_id:, campaign_id:, cluster_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignSearchTermInsights/#{campaign_id}~#{cluster_id}" + end + + ## + # Create a fully-qualified CampaignSharedSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignSharedSets/{campaign_id}~{shared_set_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param shared_set_id [String] + # + # @return [::String] + def campaign_shared_set_path customer_id:, campaign_id:, shared_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/campaignSharedSets/#{campaign_id}~#{shared_set_id}" + end + + ## + # Create a fully-qualified CampaignSimulation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignSimulations/{campaign_id}~{type}~{modification_method}~{start_date}~{end_date}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param type [String] + # @param modification_method [String] + # @param start_date [String] + # @param end_date [String] + # + # @return [::String] + def campaign_simulation_path customer_id:, campaign_id:, type:, modification_method:, start_date:, + end_date: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "type cannot contain /" if type.to_s.include? "/" + raise ::ArgumentError, "modification_method cannot contain /" if modification_method.to_s.include? "/" + raise ::ArgumentError, "start_date cannot contain /" if start_date.to_s.include? "/" + + "customers/#{customer_id}/campaignSimulations/#{campaign_id}~#{type}~#{modification_method}~#{start_date}~#{end_date}" + end + + ## + # Create a fully-qualified CarrierConstant resource string. + # + # The resource will be in the following format: + # + # `carrierConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def carrier_constant_path criterion_id: + "carrierConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified ChangeEvent resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/changeEvents/{timestamp_micros}~{command_index}~{mutate_index}` + # + # @param customer_id [String] + # @param timestamp_micros [String] + # @param command_index [String] + # @param mutate_index [String] + # + # @return [::String] + def change_event_path customer_id:, timestamp_micros:, command_index:, mutate_index: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "timestamp_micros cannot contain /" if timestamp_micros.to_s.include? "/" + raise ::ArgumentError, "command_index cannot contain /" if command_index.to_s.include? "/" + + "customers/#{customer_id}/changeEvents/#{timestamp_micros}~#{command_index}~#{mutate_index}" + end + + ## + # Create a fully-qualified ChangeStatus resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/changeStatus/{change_status_id}` + # + # @param customer_id [String] + # @param change_status_id [String] + # + # @return [::String] + def change_status_path customer_id:, change_status_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/changeStatus/#{change_status_id}" + end + + ## + # Create a fully-qualified ClickView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/clickViews/{date}~{gclid}` + # + # @param customer_id [String] + # @param date [String] + # @param gclid [String] + # + # @return [::String] + def click_view_path customer_id:, date:, gclid: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "date cannot contain /" if date.to_s.include? "/" + + "customers/#{customer_id}/clickViews/#{date}~#{gclid}" + end + + ## + # Create a fully-qualified CombinedAudience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/combinedAudiences/{combined_audience_id}` + # + # @param customer_id [String] + # @param combined_audience_id [String] + # + # @return [::String] + def combined_audience_path customer_id:, combined_audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/combinedAudiences/#{combined_audience_id}" + end + + ## + # Create a fully-qualified ConversionAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionActions/{conversion_action_id}` + # + # @param customer_id [String] + # @param conversion_action_id [String] + # + # @return [::String] + def conversion_action_path customer_id:, conversion_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionActions/#{conversion_action_id}" + end + + ## + # Create a fully-qualified ConversionCustomVariable resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionCustomVariables/{conversion_custom_variable_id}` + # + # @param customer_id [String] + # @param conversion_custom_variable_id [String] + # + # @return [::String] + def conversion_custom_variable_path customer_id:, conversion_custom_variable_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionCustomVariables/#{conversion_custom_variable_id}" + end + + ## + # Create a fully-qualified ConversionGoalCampaignConfig resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionGoalCampaignConfigs/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def conversion_goal_campaign_config_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionGoalCampaignConfigs/#{campaign_id}" + end + + ## + # Create a fully-qualified ConversionValueRule resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionValueRules/{conversion_value_rule_id}` + # + # @param customer_id [String] + # @param conversion_value_rule_id [String] + # + # @return [::String] + def conversion_value_rule_path customer_id:, conversion_value_rule_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionValueRules/#{conversion_value_rule_id}" + end + + ## + # Create a fully-qualified ConversionValueRuleSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionValueRuleSets/{conversion_value_rule_set_id}` + # + # @param customer_id [String] + # @param conversion_value_rule_set_id [String] + # + # @return [::String] + def conversion_value_rule_set_path customer_id:, conversion_value_rule_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionValueRuleSets/#{conversion_value_rule_set_id}" + end + + ## + # Create a fully-qualified CurrencyConstant resource string. + # + # The resource will be in the following format: + # + # `currencyConstants/{code}` + # + # @param code [String] + # + # @return [::String] + def currency_constant_path code: + "currencyConstants/#{code}" + end + + ## + # Create a fully-qualified CustomAudience resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customAudiences/{custom_audience_id}` + # + # @param customer_id [String] + # @param custom_audience_id [String] + # + # @return [::String] + def custom_audience_path customer_id:, custom_audience_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customAudiences/#{custom_audience_id}" + end + + ## + # Create a fully-qualified CustomConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customConversionGoals/{goal_id}` + # + # @param customer_id [String] + # @param goal_id [String] + # + # @return [::String] + def custom_conversion_goal_path customer_id:, goal_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customConversionGoals/#{goal_id}" + end + + ## + # Create a fully-qualified CustomInterest resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customInterests/{custom_interest_id}` + # + # @param customer_id [String] + # @param custom_interest_id [String] + # + # @return [::String] + def custom_interest_path customer_id:, custom_interest_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customInterests/#{custom_interest_id}" + end + + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified CustomerAsset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerAssets/{asset_id}~{field_type}` + # + # @param customer_id [String] + # @param asset_id [String] + # @param field_type [String] + # + # @return [::String] + def customer_asset_path customer_id:, asset_id:, field_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "asset_id cannot contain /" if asset_id.to_s.include? "/" + + "customers/#{customer_id}/customerAssets/#{asset_id}~#{field_type}" + end + + ## + # Create a fully-qualified CustomerAssetSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerAssetSets/{asset_set_id}` + # + # @param customer_id [String] + # @param asset_set_id [String] + # + # @return [::String] + def customer_asset_set_path customer_id:, asset_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerAssetSets/#{asset_set_id}" + end + + ## + # Create a fully-qualified CustomerClient resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerClients/{client_customer_id}` + # + # @param customer_id [String] + # @param client_customer_id [String] + # + # @return [::String] + def customer_client_path customer_id:, client_customer_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerClients/#{client_customer_id}" + end + + ## + # Create a fully-qualified CustomerClientLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerClientLinks/{client_customer_id}~{manager_link_id}` + # + # @param customer_id [String] + # @param client_customer_id [String] + # @param manager_link_id [String] + # + # @return [::String] + def customer_client_link_path customer_id:, client_customer_id:, manager_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "client_customer_id cannot contain /" if client_customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerClientLinks/#{client_customer_id}~#{manager_link_id}" + end + + ## + # Create a fully-qualified CustomerConversionGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerConversionGoals/{category}~{source}` + # + # @param customer_id [String] + # @param category [String] + # @param source [String] + # + # @return [::String] + def customer_conversion_goal_path customer_id:, category:, source: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "category cannot contain /" if category.to_s.include? "/" + + "customers/#{customer_id}/customerConversionGoals/#{category}~#{source}" + end + + ## + # Create a fully-qualified CustomerCustomizer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerCustomizers/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customer_customizer_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerCustomizers/#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified CustomerExtensionSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerExtensionSettings/{extension_type}` + # + # @param customer_id [String] + # @param extension_type [String] + # + # @return [::String] + def customer_extension_setting_path customer_id:, extension_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerExtensionSettings/#{extension_type}" + end + + ## + # Create a fully-qualified CustomerFeed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerFeeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def customer_feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerFeeds/#{feed_id}" + end + + ## + # Create a fully-qualified CustomerLabel resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerLabels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def customer_label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerLabels/#{label_id}" + end + + ## + # Create a fully-qualified CustomerLifecycleGoal resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerLifecycleGoals` + # + # @param customer_id [String] + # + # @return [::String] + def customer_lifecycle_goal_path customer_id: + "customers/#{customer_id}/customerLifecycleGoals" + end + + ## + # Create a fully-qualified CustomerManagerLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerManagerLinks/{manager_customer_id}~{manager_link_id}` + # + # @param customer_id [String] + # @param manager_customer_id [String] + # @param manager_link_id [String] + # + # @return [::String] + def customer_manager_link_path customer_id:, manager_customer_id:, manager_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "manager_customer_id cannot contain /" if manager_customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerManagerLinks/#{manager_customer_id}~#{manager_link_id}" + end + + ## + # Create a fully-qualified CustomerNegativeCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerNegativeCriteria/{criterion_id}` + # + # @param customer_id [String] + # @param criterion_id [String] + # + # @return [::String] + def customer_negative_criterion_path customer_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerNegativeCriteria/#{criterion_id}" + end + + ## + # Create a fully-qualified CustomerSearchTermInsight resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerSearchTermInsights/{cluster_id}` + # + # @param customer_id [String] + # @param cluster_id [String] + # + # @return [::String] + def customer_search_term_insight_path customer_id:, cluster_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerSearchTermInsights/#{cluster_id}" + end + + ## + # Create a fully-qualified CustomerUserAccess resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerUserAccesses/{user_id}` + # + # @param customer_id [String] + # @param user_id [String] + # + # @return [::String] + def customer_user_access_path customer_id:, user_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerUserAccesses/#{user_id}" + end + + ## + # Create a fully-qualified CustomerUserAccessInvitation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customerUserAccessInvitations/{invitation_id}` + # + # @param customer_id [String] + # @param invitation_id [String] + # + # @return [::String] + def customer_user_access_invitation_path customer_id:, invitation_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customerUserAccessInvitations/#{invitation_id}" + end + + ## + # Create a fully-qualified CustomizerAttribute resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/customizerAttributes/{customizer_attribute_id}` + # + # @param customer_id [String] + # @param customizer_attribute_id [String] + # + # @return [::String] + def customizer_attribute_path customer_id:, customizer_attribute_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/customizerAttributes/#{customizer_attribute_id}" + end + + ## + # Create a fully-qualified DetailPlacementView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/detailPlacementViews/{ad_group_id}~{base64_placement}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param base64_placement [String] + # + # @return [::String] + def detail_placement_view_path customer_id:, ad_group_id:, base64_placement: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/detailPlacementViews/#{ad_group_id}~#{base64_placement}" + end + + ## + # Create a fully-qualified DetailedDemographic resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/detailedDemographics/{detailed_demographic_id}` + # + # @param customer_id [String] + # @param detailed_demographic_id [String] + # + # @return [::String] + def detailed_demographic_path customer_id:, detailed_demographic_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/detailedDemographics/#{detailed_demographic_id}" + end + + ## + # Create a fully-qualified DisplayKeywordView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/displayKeywordViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def display_keyword_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/displayKeywordViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified DistanceView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/distanceViews/{placeholder_chain_id}~{distance_bucket}` + # + # @param customer_id [String] + # @param placeholder_chain_id [String] + # @param distance_bucket [String] + # + # @return [::String] + def distance_view_path customer_id:, placeholder_chain_id:, distance_bucket: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "placeholder_chain_id cannot contain /" if placeholder_chain_id.to_s.include? "/" + + "customers/#{customer_id}/distanceViews/#{placeholder_chain_id}~#{distance_bucket}" + end + + ## + # Create a fully-qualified DomainCategory resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/domainCategories/{campaign_id}~{base64_category}~{language_code}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param base64_category [String] + # @param language_code [String] + # + # @return [::String] + def domain_category_path customer_id:, campaign_id:, base64_category:, language_code: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "base64_category cannot contain /" if base64_category.to_s.include? "/" + + "customers/#{customer_id}/domainCategories/#{campaign_id}~#{base64_category}~#{language_code}" + end + + ## + # Create a fully-qualified DynamicSearchAdsSearchTermView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/dynamicSearchAdsSearchTermViews/{ad_group_id}~{search_term_fingerprint}~{headline_fingerprint}~{landing_page_fingerprint}~{page_url_fingerprint}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param search_term_fingerprint [String] + # @param headline_fingerprint [String] + # @param landing_page_fingerprint [String] + # @param page_url_fingerprint [String] + # + # @return [::String] + def dynamic_search_ads_search_term_view_path customer_id:, ad_group_id:, search_term_fingerprint:, + headline_fingerprint:, landing_page_fingerprint:, page_url_fingerprint: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + if search_term_fingerprint.to_s.include? "/" + raise ::ArgumentError, + "search_term_fingerprint cannot contain /" + end + raise ::ArgumentError, "headline_fingerprint cannot contain /" if headline_fingerprint.to_s.include? "/" + if landing_page_fingerprint.to_s.include? "/" + raise ::ArgumentError, + "landing_page_fingerprint cannot contain /" + end + + "customers/#{customer_id}/dynamicSearchAdsSearchTermViews/#{ad_group_id}~#{search_term_fingerprint}~#{headline_fingerprint}~#{landing_page_fingerprint}~#{page_url_fingerprint}" + end + + ## + # Create a fully-qualified ExpandedLandingPageView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/expandedLandingPageViews/{expanded_final_url_fingerprint}` + # + # @param customer_id [String] + # @param expanded_final_url_fingerprint [String] + # + # @return [::String] + def expanded_landing_page_view_path customer_id:, expanded_final_url_fingerprint: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/expandedLandingPageViews/#{expanded_final_url_fingerprint}" + end + + ## + # Create a fully-qualified Experiment resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/experiments/{trial_id}` + # + # @param customer_id [String] + # @param trial_id [String] + # + # @return [::String] + def experiment_path customer_id:, trial_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/experiments/#{trial_id}" + end + + ## + # Create a fully-qualified ExperimentArm resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/experimentArms/{trial_id}~{trial_arm_id}` + # + # @param customer_id [String] + # @param trial_id [String] + # @param trial_arm_id [String] + # + # @return [::String] + def experiment_arm_path customer_id:, trial_id:, trial_arm_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "trial_id cannot contain /" if trial_id.to_s.include? "/" + + "customers/#{customer_id}/experimentArms/#{trial_id}~#{trial_arm_id}" + end + + ## + # Create a fully-qualified ExtensionFeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/extensionFeedItems/{feed_item_id}` + # + # @param customer_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def extension_feed_item_path customer_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/extensionFeedItems/#{feed_item_id}" + end + + ## + # Create a fully-qualified Feed resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feeds/{feed_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # + # @return [::String] + def feed_path customer_id:, feed_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feeds/#{feed_id}" + end + + ## + # Create a fully-qualified FeedItem resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItems/{feed_id}~{feed_item_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def feed_item_path customer_id:, feed_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItems/#{feed_id}~#{feed_item_id}" + end + + ## + # Create a fully-qualified FeedItemSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemSets/{feed_id}~{feed_item_set_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_set_id [String] + # + # @return [::String] + def feed_item_set_path customer_id:, feed_id:, feed_item_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedItemSets/#{feed_id}~#{feed_item_set_id}" + end + + ## + # Create a fully-qualified FeedItemSetLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemSetLinks/{feed_id}~{feed_item_set_id}~{feed_item_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_set_id [String] + # @param feed_item_id [String] + # + # @return [::String] + def feed_item_set_link_path customer_id:, feed_id:, feed_item_set_id:, feed_item_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + raise ::ArgumentError, "feed_item_set_id cannot contain /" if feed_item_set_id.to_s.include? "/" + + "customers/#{customer_id}/feedItemSetLinks/#{feed_id}~#{feed_item_set_id}~#{feed_item_id}" + end + + ## + # Create a fully-qualified FeedItemTarget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedItemTargets/{feed_id}~{feed_item_id}~{feed_item_target_type}~{feed_item_target_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_item_id [String] + # @param feed_item_target_type [String] + # @param feed_item_target_id [String] + # + # @return [::String] + def feed_item_target_path customer_id:, feed_id:, feed_item_id:, feed_item_target_type:, + feed_item_target_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + raise ::ArgumentError, "feed_item_id cannot contain /" if feed_item_id.to_s.include? "/" + if feed_item_target_type.to_s.include? "/" + raise ::ArgumentError, + "feed_item_target_type cannot contain /" + end + + "customers/#{customer_id}/feedItemTargets/#{feed_id}~#{feed_item_id}~#{feed_item_target_type}~#{feed_item_target_id}" + end + + ## + # Create a fully-qualified FeedMapping resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedMappings/{feed_id}~{feed_mapping_id}` + # + # @param customer_id [String] + # @param feed_id [String] + # @param feed_mapping_id [String] + # + # @return [::String] + def feed_mapping_path customer_id:, feed_id:, feed_mapping_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "feed_id cannot contain /" if feed_id.to_s.include? "/" + + "customers/#{customer_id}/feedMappings/#{feed_id}~#{feed_mapping_id}" + end + + ## + # Create a fully-qualified FeedPlaceholderView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/feedPlaceholderViews/{placeholder_type}` + # + # @param customer_id [String] + # @param placeholder_type [String] + # + # @return [::String] + def feed_placeholder_view_path customer_id:, placeholder_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/feedPlaceholderViews/#{placeholder_type}" + end + + ## + # Create a fully-qualified GenderView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/genderViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def gender_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/genderViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified GeoTargetConstant resource string. + # + # The resource will be in the following format: + # + # `geoTargetConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def geo_target_constant_path criterion_id: + "geoTargetConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified GeographicView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/geographicViews/{country_criterion_id}~{location_type}` + # + # @param customer_id [String] + # @param country_criterion_id [String] + # @param location_type [String] + # + # @return [::String] + def geographic_view_path customer_id:, country_criterion_id:, location_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "country_criterion_id cannot contain /" if country_criterion_id.to_s.include? "/" + + "customers/#{customer_id}/geographicViews/#{country_criterion_id}~#{location_type}" + end + + ## + # Create a fully-qualified GroupPlacementView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/groupPlacementViews/{ad_group_id}~{base64_placement}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param base64_placement [String] + # + # @return [::String] + def group_placement_view_path customer_id:, ad_group_id:, base64_placement: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/groupPlacementViews/#{ad_group_id}~#{base64_placement}" + end + + ## + # Create a fully-qualified HotelGroupView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/hotelGroupViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def hotel_group_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/hotelGroupViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified HotelPerformanceView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/hotelPerformanceView` + # + # @param customer_id [String] + # + # @return [::String] + def hotel_performance_view_path customer_id: + "customers/#{customer_id}/hotelPerformanceView" + end + + ## + # Create a fully-qualified HotelReconciliation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/hotelReconciliations/{commission_id}` + # + # @param customer_id [String] + # @param commission_id [String] + # + # @return [::String] + def hotel_reconciliation_path customer_id:, commission_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/hotelReconciliations/#{commission_id}" + end + + ## + # Create a fully-qualified IncomeRangeView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/incomeRangeViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def income_range_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/incomeRangeViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified KeywordPlan resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlans/{keyword_plan_id}` + # + # @param customer_id [String] + # @param keyword_plan_id [String] + # + # @return [::String] + def keyword_plan_path customer_id:, keyword_plan_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlans/#{keyword_plan_id}" + end + + ## + # Create a fully-qualified KeywordPlanAdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanAdGroups/{keyword_plan_ad_group_id}` + # + # @param customer_id [String] + # @param keyword_plan_ad_group_id [String] + # + # @return [::String] + def keyword_plan_ad_group_path customer_id:, keyword_plan_ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanAdGroups/#{keyword_plan_ad_group_id}" + end + + ## + # Create a fully-qualified KeywordPlanAdGroupKeyword resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanAdGroupKeywords/{keyword_plan_ad_group_keyword_id}` + # + # @param customer_id [String] + # @param keyword_plan_ad_group_keyword_id [String] + # + # @return [::String] + def keyword_plan_ad_group_keyword_path customer_id:, keyword_plan_ad_group_keyword_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanAdGroupKeywords/#{keyword_plan_ad_group_keyword_id}" + end + + ## + # Create a fully-qualified KeywordPlanCampaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}` + # + # @param customer_id [String] + # @param keyword_plan_campaign_id [String] + # + # @return [::String] + def keyword_plan_campaign_path customer_id:, keyword_plan_campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanCampaigns/#{keyword_plan_campaign_id}" + end + + ## + # Create a fully-qualified KeywordPlanCampaignKeyword resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanCampaignKeywords/{keyword_plan_campaign_keyword_id}` + # + # @param customer_id [String] + # @param keyword_plan_campaign_keyword_id [String] + # + # @return [::String] + def keyword_plan_campaign_keyword_path customer_id:, keyword_plan_campaign_keyword_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanCampaignKeywords/#{keyword_plan_campaign_keyword_id}" + end + + ## + # Create a fully-qualified KeywordThemeConstant resource string. + # + # The resource will be in the following format: + # + # `keywordThemeConstants/{express_category_id}~{express_sub_category_id}` + # + # @param express_category_id [String] + # @param express_sub_category_id [String] + # + # @return [::String] + def keyword_theme_constant_path express_category_id:, express_sub_category_id: + raise ::ArgumentError, "express_category_id cannot contain /" if express_category_id.to_s.include? "/" + + "keywordThemeConstants/#{express_category_id}~#{express_sub_category_id}" + end + + ## + # Create a fully-qualified KeywordView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def keyword_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/keywordViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified Label resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/labels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/labels/#{label_id}" + end + + ## + # Create a fully-qualified LandingPageView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/landingPageViews/{unexpanded_final_url_fingerprint}` + # + # @param customer_id [String] + # @param unexpanded_final_url_fingerprint [String] + # + # @return [::String] + def landing_page_view_path customer_id:, unexpanded_final_url_fingerprint: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/landingPageViews/#{unexpanded_final_url_fingerprint}" + end + + ## + # Create a fully-qualified LanguageConstant resource string. + # + # The resource will be in the following format: + # + # `languageConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def language_constant_path criterion_id: + "languageConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified LeadFormSubmissionData resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/leadFormSubmissionData/{lead_form_user_submission_id}` + # + # @param customer_id [String] + # @param lead_form_user_submission_id [String] + # + # @return [::String] + def lead_form_submission_data_path customer_id:, lead_form_user_submission_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/leadFormSubmissionData/#{lead_form_user_submission_id}" + end + + ## + # Create a fully-qualified LifeEvent resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/lifeEvents/{life_event_id}` + # + # @param customer_id [String] + # @param life_event_id [String] + # + # @return [::String] + def life_event_path customer_id:, life_event_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/lifeEvents/#{life_event_id}" + end + + ## + # Create a fully-qualified LocalServicesEmployee resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/localServicesEmployees/{gls_employee_id}` + # + # @param customer_id [String] + # @param gls_employee_id [String] + # + # @return [::String] + def local_services_employee_path customer_id:, gls_employee_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/localServicesEmployees/#{gls_employee_id}" + end + + ## + # Create a fully-qualified LocalServicesLead resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/localServicesLeads/{local_services_lead_id}` + # + # @param customer_id [String] + # @param local_services_lead_id [String] + # + # @return [::String] + def local_services_lead_path customer_id:, local_services_lead_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/localServicesLeads/#{local_services_lead_id}" + end + + ## + # Create a fully-qualified LocalServicesLeadConversation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/localServicesLeadConversations/{local_services_lead_conversation_id}` + # + # @param customer_id [String] + # @param local_services_lead_conversation_id [String] + # + # @return [::String] + def local_services_lead_conversation_path customer_id:, local_services_lead_conversation_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/localServicesLeadConversations/#{local_services_lead_conversation_id}" + end + + ## + # Create a fully-qualified LocalServicesVerificationArtifact resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/localServicesVerificationArtifacts/{gls_verification_artifact_id}` + # + # @param customer_id [String] + # @param gls_verification_artifact_id [String] + # + # @return [::String] + def local_services_verification_artifact_path customer_id:, gls_verification_artifact_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/localServicesVerificationArtifacts/#{gls_verification_artifact_id}" + end + + ## + # Create a fully-qualified LocationView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/locationViews/{campaign_id}~{criterion_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param criterion_id [String] + # + # @return [::String] + def location_view_path customer_id:, campaign_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/locationViews/#{campaign_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified ManagedPlacementView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/managedPlacementViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def managed_placement_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/managedPlacementViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified MediaFile resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/mediaFiles/{media_file_id}` + # + # @param customer_id [String] + # @param media_file_id [String] + # + # @return [::String] + def media_file_path customer_id:, media_file_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/mediaFiles/#{media_file_id}" + end + + ## + # Create a fully-qualified MobileAppCategoryConstant resource string. + # + # The resource will be in the following format: + # + # `mobileAppCategoryConstants/{mobile_app_category_id}` + # + # @param mobile_app_category_id [String] + # + # @return [::String] + def mobile_app_category_constant_path mobile_app_category_id: + "mobileAppCategoryConstants/#{mobile_app_category_id}" + end + + ## + # Create a fully-qualified MobileDeviceConstant resource string. + # + # The resource will be in the following format: + # + # `mobileDeviceConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def mobile_device_constant_path criterion_id: + "mobileDeviceConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified OfflineConversionUploadClientSummary resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/offlineConversionUploadClientSummaries/{client}` + # + # @param customer_id [String] + # @param client [String] + # + # @return [::String] + def offline_conversion_upload_client_summary_path customer_id:, client: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/offlineConversionUploadClientSummaries/#{client}" + end + + ## + # Create a fully-qualified OfflineUserDataJob resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/offlineUserDataJobs/{offline_user_data_update_id}` + # + # @param customer_id [String] + # @param offline_user_data_update_id [String] + # + # @return [::String] + def offline_user_data_job_path customer_id:, offline_user_data_update_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/offlineUserDataJobs/#{offline_user_data_update_id}" + end + + ## + # Create a fully-qualified OperatingSystemVersionConstant resource string. + # + # The resource will be in the following format: + # + # `operatingSystemVersionConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def operating_system_version_constant_path criterion_id: + "operatingSystemVersionConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified PaidOrganicSearchTermView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/paidOrganicSearchTermViews/{campaign_id}~{ad_group_id}~{base64_search_term}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param ad_group_id [String] + # @param base64_search_term [String] + # + # @return [::String] + def paid_organic_search_term_view_path customer_id:, campaign_id:, ad_group_id:, base64_search_term: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/paidOrganicSearchTermViews/#{campaign_id}~#{ad_group_id}~#{base64_search_term}" + end + + ## + # Create a fully-qualified ParentalStatusView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/parentalStatusViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def parental_status_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/parentalStatusViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified PaymentsAccount resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/paymentsAccounts/{payments_account_id}` + # + # @param customer_id [String] + # @param payments_account_id [String] + # + # @return [::String] + def payments_account_path customer_id:, payments_account_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/paymentsAccounts/#{payments_account_id}" + end + + ## + # Create a fully-qualified PerStoreView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/perStoreViews/{place_id}` + # + # @param customer_id [String] + # @param place_id [String] + # + # @return [::String] + def per_store_view_path customer_id:, place_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/perStoreViews/#{place_id}" + end + + ## + # Create a fully-qualified ProductCategoryConstant resource string. + # + # The resource will be in the following format: + # + # `productCategoryConstants/{level}~{category_id}` + # + # @param level [String] + # @param category_id [String] + # + # @return [::String] + def product_category_constant_path level:, category_id: + raise ::ArgumentError, "level cannot contain /" if level.to_s.include? "/" + + "productCategoryConstants/#{level}~#{category_id}" + end + + ## + # Create a fully-qualified ProductGroupView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/productGroupViews/{adgroup_id}~{criterion_id}` + # + # @param customer_id [String] + # @param adgroup_id [String] + # @param criterion_id [String] + # + # @return [::String] + def product_group_view_path customer_id:, adgroup_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "adgroup_id cannot contain /" if adgroup_id.to_s.include? "/" + + "customers/#{customer_id}/productGroupViews/#{adgroup_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified ProductLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/productLinks/{product_link_id}` + # + # @param customer_id [String] + # @param product_link_id [String] + # + # @return [::String] + def product_link_path customer_id:, product_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/productLinks/#{product_link_id}" + end + + ## + # Create a fully-qualified ProductLinkInvitation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/productLinkInvitations/{customer_invitation_id}` + # + # @param customer_id [String] + # @param customer_invitation_id [String] + # + # @return [::String] + def product_link_invitation_path customer_id:, customer_invitation_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/productLinkInvitations/#{customer_invitation_id}" + end + + ## + # Create a fully-qualified QualifyingQuestion resource string. + # + # The resource will be in the following format: + # + # `qualifyingQuestions/{qualifying_question_id}` + # + # @param qualifying_question_id [String] + # + # @return [::String] + def qualifying_question_path qualifying_question_id: + "qualifyingQuestions/#{qualifying_question_id}" + end + + ## + # Create a fully-qualified Recommendation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/recommendations/{recommendation_id}` + # + # @param customer_id [String] + # @param recommendation_id [String] + # + # @return [::String] + def recommendation_path customer_id:, recommendation_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/recommendations/#{recommendation_id}" + end + + ## + # Create a fully-qualified RecommendationSubscription resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/recommendationSubscriptions/{recommendation_type}` + # + # @param customer_id [String] + # @param recommendation_type [String] + # + # @return [::String] + def recommendation_subscription_path customer_id:, recommendation_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/recommendationSubscriptions/#{recommendation_type}" + end + + ## + # Create a fully-qualified RemarketingAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/remarketingActions/{remarketing_action_id}` + # + # @param customer_id [String] + # @param remarketing_action_id [String] + # + # @return [::String] + def remarketing_action_path customer_id:, remarketing_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/remarketingActions/#{remarketing_action_id}" + end + + ## + # Create a fully-qualified SearchTermView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/searchTermViews/{campaign_id}~{ad_group_id}~{query}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param ad_group_id [String] + # @param query [String] + # + # @return [::String] + def search_term_view_path customer_id:, campaign_id:, ad_group_id:, query: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/searchTermViews/#{campaign_id}~#{ad_group_id}~#{query}" + end + + ## + # Create a fully-qualified SharedCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}` + # + # @param customer_id [String] + # @param shared_set_id [String] + # @param criterion_id [String] + # + # @return [::String] + def shared_criterion_path customer_id:, shared_set_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "shared_set_id cannot contain /" if shared_set_id.to_s.include? "/" + + "customers/#{customer_id}/sharedCriteria/#{shared_set_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified SharedSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/sharedSets/{shared_set_id}` + # + # @param customer_id [String] + # @param shared_set_id [String] + # + # @return [::String] + def shared_set_path customer_id:, shared_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/sharedSets/#{shared_set_id}" + end + + ## + # Create a fully-qualified ShoppingPerformanceView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/shoppingPerformanceView` + # + # @param customer_id [String] + # + # @return [::String] + def shopping_performance_view_path customer_id: + "customers/#{customer_id}/shoppingPerformanceView" + end + + ## + # Create a fully-qualified SmartCampaignSearchTermView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/smartCampaignSearchTermViews/{campaign_id}~{query}` + # + # @param customer_id [String] + # @param campaign_id [String] + # @param query [String] + # + # @return [::String] + def smart_campaign_search_term_view_path customer_id:, campaign_id:, query: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "campaign_id cannot contain /" if campaign_id.to_s.include? "/" + + "customers/#{customer_id}/smartCampaignSearchTermViews/#{campaign_id}~#{query}" + end + + ## + # Create a fully-qualified SmartCampaignSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/smartCampaignSettings/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def smart_campaign_setting_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/smartCampaignSettings/#{campaign_id}" + end + + ## + # Create a fully-qualified ThirdPartyAppAnalyticsLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/thirdPartyAppAnalyticsLinks/{customer_link_id}` + # + # @param customer_id [String] + # @param customer_link_id [String] + # + # @return [::String] + def third_party_app_analytics_link_path customer_id:, customer_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/thirdPartyAppAnalyticsLinks/#{customer_link_id}" + end + + ## + # Create a fully-qualified TopicConstant resource string. + # + # The resource will be in the following format: + # + # `topicConstants/{topic_id}` + # + # @param topic_id [String] + # + # @return [::String] + def topic_constant_path topic_id: + "topicConstants/#{topic_id}" + end + + ## + # Create a fully-qualified TopicView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/topicViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def topic_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/topicViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified TravelActivityGroupView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/travelActivityGroupViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def travel_activity_group_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/travelActivityGroupViews/#{ad_group_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified TravelActivityPerformanceView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/travelActivityPerformanceViews` + # + # @param customer_id [String] + # + # @return [::String] + def travel_activity_performance_view_path customer_id: + "customers/#{customer_id}/travelActivityPerformanceViews" + end + + ## + # Create a fully-qualified UserInterest resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userInterests/{user_interest_id}` + # + # @param customer_id [String] + # @param user_interest_id [String] + # + # @return [::String] + def user_interest_path customer_id:, user_interest_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/userInterests/#{user_interest_id}" + end + + ## + # Create a fully-qualified UserList resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userLists/{user_list_id}` + # + # @param customer_id [String] + # @param user_list_id [String] + # + # @return [::String] + def user_list_path customer_id:, user_list_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/userLists/#{user_list_id}" + end + + ## + # Create a fully-qualified UserLocationView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userLocationViews/{country_criterion_id}~{is_targeting_location}` + # + # @param customer_id [String] + # @param country_criterion_id [String] + # @param is_targeting_location [String] + # + # @return [::String] + def user_location_view_path customer_id:, country_criterion_id:, is_targeting_location: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "country_criterion_id cannot contain /" if country_criterion_id.to_s.include? "/" + + "customers/#{customer_id}/userLocationViews/#{country_criterion_id}~#{is_targeting_location}" + end + + ## + # Create a fully-qualified Video resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/videos/{video_id}` + # + # @param customer_id [String] + # @param video_id [String] + # + # @return [::String] + def video_path customer_id:, video_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/videos/#{video_id}" + end + + ## + # Create a fully-qualified WebpageView resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/webpageViews/{ad_group_id}~{criterion_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # @param criterion_id [String] + # + # @return [::String] + def webpage_view_path customer_id:, ad_group_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "ad_group_id cannot contain /" if ad_group_id.to_s.include? "/" + + "customers/#{customer_id}/webpageViews/#{ad_group_id}~#{criterion_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_service_pb.rb b/lib/google/ads/google_ads/v16/services/google_ads_service_pb.rb new file mode 100644 index 000000000..eeea6920e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_service_pb.rb @@ -0,0 +1,560 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/google_ads_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/metrics_pb' +require 'google/ads/google_ads/v16/common/segments_pb' +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/enums/summary_row_setting_pb' +require 'google/ads/google_ads/v16/resources/accessible_bidding_strategy_pb' +require 'google/ads/google_ads/v16/resources/account_budget_pb' +require 'google/ads/google_ads/v16/resources/account_budget_proposal_pb' +require 'google/ads/google_ads/v16/resources/account_link_pb' +require 'google/ads/google_ads/v16/resources/ad_group_pb' +require 'google/ads/google_ads/v16/resources/ad_group_ad_pb' +require 'google/ads/google_ads/v16/resources/ad_group_ad_asset_combination_view_pb' +require 'google/ads/google_ads/v16/resources/ad_group_ad_asset_view_pb' +require 'google/ads/google_ads/v16/resources/ad_group_ad_label_pb' +require 'google/ads/google_ads/v16/resources/ad_group_asset_pb' +require 'google/ads/google_ads/v16/resources/ad_group_asset_set_pb' +require 'google/ads/google_ads/v16/resources/ad_group_audience_view_pb' +require 'google/ads/google_ads/v16/resources/ad_group_bid_modifier_pb' +require 'google/ads/google_ads/v16/resources/ad_group_criterion_pb' +require 'google/ads/google_ads/v16/resources/ad_group_criterion_customizer_pb' +require 'google/ads/google_ads/v16/resources/ad_group_criterion_label_pb' +require 'google/ads/google_ads/v16/resources/ad_group_criterion_simulation_pb' +require 'google/ads/google_ads/v16/resources/ad_group_customizer_pb' +require 'google/ads/google_ads/v16/resources/ad_group_extension_setting_pb' +require 'google/ads/google_ads/v16/resources/ad_group_feed_pb' +require 'google/ads/google_ads/v16/resources/ad_group_label_pb' +require 'google/ads/google_ads/v16/resources/ad_group_simulation_pb' +require 'google/ads/google_ads/v16/resources/ad_parameter_pb' +require 'google/ads/google_ads/v16/resources/ad_schedule_view_pb' +require 'google/ads/google_ads/v16/resources/age_range_view_pb' +require 'google/ads/google_ads/v16/resources/android_privacy_shared_key_google_ad_group_pb' +require 'google/ads/google_ads/v16/resources/android_privacy_shared_key_google_campaign_pb' +require 'google/ads/google_ads/v16/resources/android_privacy_shared_key_google_network_type_pb' +require 'google/ads/google_ads/v16/resources/asset_pb' +require 'google/ads/google_ads/v16/resources/asset_field_type_view_pb' +require 'google/ads/google_ads/v16/resources/asset_group_pb' +require 'google/ads/google_ads/v16/resources/asset_group_asset_pb' +require 'google/ads/google_ads/v16/resources/asset_group_listing_group_filter_pb' +require 'google/ads/google_ads/v16/resources/asset_group_product_group_view_pb' +require 'google/ads/google_ads/v16/resources/asset_group_signal_pb' +require 'google/ads/google_ads/v16/resources/asset_group_top_combination_view_pb' +require 'google/ads/google_ads/v16/resources/asset_set_pb' +require 'google/ads/google_ads/v16/resources/asset_set_asset_pb' +require 'google/ads/google_ads/v16/resources/asset_set_type_view_pb' +require 'google/ads/google_ads/v16/resources/audience_pb' +require 'google/ads/google_ads/v16/resources/batch_job_pb' +require 'google/ads/google_ads/v16/resources/bidding_data_exclusion_pb' +require 'google/ads/google_ads/v16/resources/bidding_seasonality_adjustment_pb' +require 'google/ads/google_ads/v16/resources/bidding_strategy_pb' +require 'google/ads/google_ads/v16/resources/bidding_strategy_simulation_pb' +require 'google/ads/google_ads/v16/resources/billing_setup_pb' +require 'google/ads/google_ads/v16/resources/call_view_pb' +require 'google/ads/google_ads/v16/resources/campaign_pb' +require 'google/ads/google_ads/v16/resources/campaign_asset_pb' +require 'google/ads/google_ads/v16/resources/campaign_asset_set_pb' +require 'google/ads/google_ads/v16/resources/campaign_audience_view_pb' +require 'google/ads/google_ads/v16/resources/campaign_bid_modifier_pb' +require 'google/ads/google_ads/v16/resources/campaign_budget_pb' +require 'google/ads/google_ads/v16/resources/campaign_conversion_goal_pb' +require 'google/ads/google_ads/v16/resources/campaign_criterion_pb' +require 'google/ads/google_ads/v16/resources/campaign_customizer_pb' +require 'google/ads/google_ads/v16/resources/campaign_draft_pb' +require 'google/ads/google_ads/v16/resources/campaign_extension_setting_pb' +require 'google/ads/google_ads/v16/resources/campaign_feed_pb' +require 'google/ads/google_ads/v16/resources/campaign_group_pb' +require 'google/ads/google_ads/v16/resources/campaign_label_pb' +require 'google/ads/google_ads/v16/resources/campaign_lifecycle_goal_pb' +require 'google/ads/google_ads/v16/resources/campaign_search_term_insight_pb' +require 'google/ads/google_ads/v16/resources/campaign_shared_set_pb' +require 'google/ads/google_ads/v16/resources/campaign_simulation_pb' +require 'google/ads/google_ads/v16/resources/carrier_constant_pb' +require 'google/ads/google_ads/v16/resources/change_event_pb' +require 'google/ads/google_ads/v16/resources/change_status_pb' +require 'google/ads/google_ads/v16/resources/click_view_pb' +require 'google/ads/google_ads/v16/resources/combined_audience_pb' +require 'google/ads/google_ads/v16/resources/conversion_action_pb' +require 'google/ads/google_ads/v16/resources/conversion_custom_variable_pb' +require 'google/ads/google_ads/v16/resources/conversion_goal_campaign_config_pb' +require 'google/ads/google_ads/v16/resources/conversion_value_rule_pb' +require 'google/ads/google_ads/v16/resources/conversion_value_rule_set_pb' +require 'google/ads/google_ads/v16/resources/currency_constant_pb' +require 'google/ads/google_ads/v16/resources/custom_audience_pb' +require 'google/ads/google_ads/v16/resources/custom_conversion_goal_pb' +require 'google/ads/google_ads/v16/resources/custom_interest_pb' +require 'google/ads/google_ads/v16/resources/customer_pb' +require 'google/ads/google_ads/v16/resources/customer_asset_pb' +require 'google/ads/google_ads/v16/resources/customer_asset_set_pb' +require 'google/ads/google_ads/v16/resources/customer_client_pb' +require 'google/ads/google_ads/v16/resources/customer_client_link_pb' +require 'google/ads/google_ads/v16/resources/customer_conversion_goal_pb' +require 'google/ads/google_ads/v16/resources/customer_customizer_pb' +require 'google/ads/google_ads/v16/resources/customer_extension_setting_pb' +require 'google/ads/google_ads/v16/resources/customer_feed_pb' +require 'google/ads/google_ads/v16/resources/customer_label_pb' +require 'google/ads/google_ads/v16/resources/customer_lifecycle_goal_pb' +require 'google/ads/google_ads/v16/resources/customer_manager_link_pb' +require 'google/ads/google_ads/v16/resources/customer_negative_criterion_pb' +require 'google/ads/google_ads/v16/resources/customer_search_term_insight_pb' +require 'google/ads/google_ads/v16/resources/customer_user_access_pb' +require 'google/ads/google_ads/v16/resources/customer_user_access_invitation_pb' +require 'google/ads/google_ads/v16/resources/customizer_attribute_pb' +require 'google/ads/google_ads/v16/resources/detail_placement_view_pb' +require 'google/ads/google_ads/v16/resources/detailed_demographic_pb' +require 'google/ads/google_ads/v16/resources/display_keyword_view_pb' +require 'google/ads/google_ads/v16/resources/distance_view_pb' +require 'google/ads/google_ads/v16/resources/domain_category_pb' +require 'google/ads/google_ads/v16/resources/dynamic_search_ads_search_term_view_pb' +require 'google/ads/google_ads/v16/resources/expanded_landing_page_view_pb' +require 'google/ads/google_ads/v16/resources/experiment_pb' +require 'google/ads/google_ads/v16/resources/experiment_arm_pb' +require 'google/ads/google_ads/v16/resources/extension_feed_item_pb' +require 'google/ads/google_ads/v16/resources/feed_pb' +require 'google/ads/google_ads/v16/resources/feed_item_pb' +require 'google/ads/google_ads/v16/resources/feed_item_set_pb' +require 'google/ads/google_ads/v16/resources/feed_item_set_link_pb' +require 'google/ads/google_ads/v16/resources/feed_item_target_pb' +require 'google/ads/google_ads/v16/resources/feed_mapping_pb' +require 'google/ads/google_ads/v16/resources/feed_placeholder_view_pb' +require 'google/ads/google_ads/v16/resources/gender_view_pb' +require 'google/ads/google_ads/v16/resources/geo_target_constant_pb' +require 'google/ads/google_ads/v16/resources/geographic_view_pb' +require 'google/ads/google_ads/v16/resources/group_placement_view_pb' +require 'google/ads/google_ads/v16/resources/hotel_group_view_pb' +require 'google/ads/google_ads/v16/resources/hotel_performance_view_pb' +require 'google/ads/google_ads/v16/resources/hotel_reconciliation_pb' +require 'google/ads/google_ads/v16/resources/income_range_view_pb' +require 'google/ads/google_ads/v16/resources/keyword_plan_pb' +require 'google/ads/google_ads/v16/resources/keyword_plan_ad_group_pb' +require 'google/ads/google_ads/v16/resources/keyword_plan_ad_group_keyword_pb' +require 'google/ads/google_ads/v16/resources/keyword_plan_campaign_pb' +require 'google/ads/google_ads/v16/resources/keyword_plan_campaign_keyword_pb' +require 'google/ads/google_ads/v16/resources/keyword_theme_constant_pb' +require 'google/ads/google_ads/v16/resources/keyword_view_pb' +require 'google/ads/google_ads/v16/resources/label_pb' +require 'google/ads/google_ads/v16/resources/landing_page_view_pb' +require 'google/ads/google_ads/v16/resources/language_constant_pb' +require 'google/ads/google_ads/v16/resources/lead_form_submission_data_pb' +require 'google/ads/google_ads/v16/resources/life_event_pb' +require 'google/ads/google_ads/v16/resources/local_services_employee_pb' +require 'google/ads/google_ads/v16/resources/local_services_lead_pb' +require 'google/ads/google_ads/v16/resources/local_services_lead_conversation_pb' +require 'google/ads/google_ads/v16/resources/local_services_verification_artifact_pb' +require 'google/ads/google_ads/v16/resources/location_view_pb' +require 'google/ads/google_ads/v16/resources/managed_placement_view_pb' +require 'google/ads/google_ads/v16/resources/media_file_pb' +require 'google/ads/google_ads/v16/resources/mobile_app_category_constant_pb' +require 'google/ads/google_ads/v16/resources/mobile_device_constant_pb' +require 'google/ads/google_ads/v16/resources/offline_conversion_upload_client_summary_pb' +require 'google/ads/google_ads/v16/resources/offline_user_data_job_pb' +require 'google/ads/google_ads/v16/resources/operating_system_version_constant_pb' +require 'google/ads/google_ads/v16/resources/paid_organic_search_term_view_pb' +require 'google/ads/google_ads/v16/resources/parental_status_view_pb' +require 'google/ads/google_ads/v16/resources/per_store_view_pb' +require 'google/ads/google_ads/v16/resources/product_category_constant_pb' +require 'google/ads/google_ads/v16/resources/product_group_view_pb' +require 'google/ads/google_ads/v16/resources/product_link_pb' +require 'google/ads/google_ads/v16/resources/product_link_invitation_pb' +require 'google/ads/google_ads/v16/resources/qualifying_question_pb' +require 'google/ads/google_ads/v16/resources/recommendation_pb' +require 'google/ads/google_ads/v16/resources/recommendation_subscription_pb' +require 'google/ads/google_ads/v16/resources/remarketing_action_pb' +require 'google/ads/google_ads/v16/resources/search_term_view_pb' +require 'google/ads/google_ads/v16/resources/shared_criterion_pb' +require 'google/ads/google_ads/v16/resources/shared_set_pb' +require 'google/ads/google_ads/v16/resources/shopping_performance_view_pb' +require 'google/ads/google_ads/v16/resources/smart_campaign_search_term_view_pb' +require 'google/ads/google_ads/v16/resources/smart_campaign_setting_pb' +require 'google/ads/google_ads/v16/resources/third_party_app_analytics_link_pb' +require 'google/ads/google_ads/v16/resources/topic_constant_pb' +require 'google/ads/google_ads/v16/resources/topic_view_pb' +require 'google/ads/google_ads/v16/resources/travel_activity_group_view_pb' +require 'google/ads/google_ads/v16/resources/travel_activity_performance_view_pb' +require 'google/ads/google_ads/v16/resources/user_interest_pb' +require 'google/ads/google_ads/v16/resources/user_list_pb' +require 'google/ads/google_ads/v16/resources/user_location_view_pb' +require 'google/ads/google_ads/v16/resources/video_pb' +require 'google/ads/google_ads/v16/resources/webpage_view_pb' +require 'google/ads/google_ads/v16/services/ad_group_ad_label_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_ad_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_asset_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_bid_modifier_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_criterion_customizer_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_criterion_label_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_criterion_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_customizer_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_extension_setting_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_feed_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_label_service_pb' +require 'google/ads/google_ads/v16/services/ad_group_service_pb' +require 'google/ads/google_ads/v16/services/ad_parameter_service_pb' +require 'google/ads/google_ads/v16/services/ad_service_pb' +require 'google/ads/google_ads/v16/services/asset_group_asset_service_pb' +require 'google/ads/google_ads/v16/services/asset_group_listing_group_filter_service_pb' +require 'google/ads/google_ads/v16/services/asset_group_service_pb' +require 'google/ads/google_ads/v16/services/asset_group_signal_service_pb' +require 'google/ads/google_ads/v16/services/asset_service_pb' +require 'google/ads/google_ads/v16/services/asset_set_asset_service_pb' +require 'google/ads/google_ads/v16/services/asset_set_service_pb' +require 'google/ads/google_ads/v16/services/audience_service_pb' +require 'google/ads/google_ads/v16/services/bidding_data_exclusion_service_pb' +require 'google/ads/google_ads/v16/services/bidding_seasonality_adjustment_service_pb' +require 'google/ads/google_ads/v16/services/bidding_strategy_service_pb' +require 'google/ads/google_ads/v16/services/campaign_asset_service_pb' +require 'google/ads/google_ads/v16/services/campaign_asset_set_service_pb' +require 'google/ads/google_ads/v16/services/campaign_bid_modifier_service_pb' +require 'google/ads/google_ads/v16/services/campaign_budget_service_pb' +require 'google/ads/google_ads/v16/services/campaign_conversion_goal_service_pb' +require 'google/ads/google_ads/v16/services/campaign_criterion_service_pb' +require 'google/ads/google_ads/v16/services/campaign_customizer_service_pb' +require 'google/ads/google_ads/v16/services/campaign_draft_service_pb' +require 'google/ads/google_ads/v16/services/campaign_extension_setting_service_pb' +require 'google/ads/google_ads/v16/services/campaign_feed_service_pb' +require 'google/ads/google_ads/v16/services/campaign_group_service_pb' +require 'google/ads/google_ads/v16/services/campaign_label_service_pb' +require 'google/ads/google_ads/v16/services/campaign_service_pb' +require 'google/ads/google_ads/v16/services/campaign_shared_set_service_pb' +require 'google/ads/google_ads/v16/services/conversion_action_service_pb' +require 'google/ads/google_ads/v16/services/conversion_custom_variable_service_pb' +require 'google/ads/google_ads/v16/services/conversion_goal_campaign_config_service_pb' +require 'google/ads/google_ads/v16/services/conversion_value_rule_service_pb' +require 'google/ads/google_ads/v16/services/conversion_value_rule_set_service_pb' +require 'google/ads/google_ads/v16/services/custom_conversion_goal_service_pb' +require 'google/ads/google_ads/v16/services/customer_asset_service_pb' +require 'google/ads/google_ads/v16/services/customer_conversion_goal_service_pb' +require 'google/ads/google_ads/v16/services/customer_customizer_service_pb' +require 'google/ads/google_ads/v16/services/customer_extension_setting_service_pb' +require 'google/ads/google_ads/v16/services/customer_feed_service_pb' +require 'google/ads/google_ads/v16/services/customer_label_service_pb' +require 'google/ads/google_ads/v16/services/customer_negative_criterion_service_pb' +require 'google/ads/google_ads/v16/services/customer_service_pb' +require 'google/ads/google_ads/v16/services/customizer_attribute_service_pb' +require 'google/ads/google_ads/v16/services/experiment_arm_service_pb' +require 'google/ads/google_ads/v16/services/experiment_service_pb' +require 'google/ads/google_ads/v16/services/extension_feed_item_service_pb' +require 'google/ads/google_ads/v16/services/feed_item_service_pb' +require 'google/ads/google_ads/v16/services/feed_item_set_link_service_pb' +require 'google/ads/google_ads/v16/services/feed_item_set_service_pb' +require 'google/ads/google_ads/v16/services/feed_item_target_service_pb' +require 'google/ads/google_ads/v16/services/feed_mapping_service_pb' +require 'google/ads/google_ads/v16/services/feed_service_pb' +require 'google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_pb' +require 'google/ads/google_ads/v16/services/keyword_plan_ad_group_service_pb' +require 'google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_pb' +require 'google/ads/google_ads/v16/services/keyword_plan_campaign_service_pb' +require 'google/ads/google_ads/v16/services/keyword_plan_service_pb' +require 'google/ads/google_ads/v16/services/label_service_pb' +require 'google/ads/google_ads/v16/services/recommendation_subscription_service_pb' +require 'google/ads/google_ads/v16/services/remarketing_action_service_pb' +require 'google/ads/google_ads/v16/services/shared_criterion_service_pb' +require 'google/ads/google_ads/v16/services/shared_set_service_pb' +require 'google/ads/google_ads/v16/services/smart_campaign_setting_service_pb' +require 'google/ads/google_ads/v16/services/user_list_service_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/services/google_ads_service.proto\x12!google.ads.googleads.v16.services\x1a-google/ads/googleads/v16/common/metrics.proto\x1a.google/ads/googleads/v16/common/segments.proto\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x38google/ads/googleads/v16/enums/summary_row_setting.proto\x1a\x44google/ads/googleads/v16/resources/accessible_bidding_strategy.proto\x1a\x37google/ads/googleads/v16/resources/account_budget.proto\x1a@google/ads/googleads/v16/resources/account_budget_proposal.proto\x1a\x35google/ads/googleads/v16/resources/account_link.proto\x1a\x31google/ads/googleads/v16/resources/ad_group.proto\x1a\x34google/ads/googleads/v16/resources/ad_group_ad.proto\x1aKgoogle/ads/googleads/v16/resources/ad_group_ad_asset_combination_view.proto\x1a?google/ads/googleads/v16/resources/ad_group_ad_asset_view.proto\x1a:google/ads/googleads/v16/resources/ad_group_ad_label.proto\x1a\x37google/ads/googleads/v16/resources/ad_group_asset.proto\x1a;google/ads/googleads/v16/resources/ad_group_asset_set.proto\x1a?google/ads/googleads/v16/resources/ad_group_audience_view.proto\x1a>google/ads/googleads/v16/resources/ad_group_bid_modifier.proto\x1a;google/ads/googleads/v16/resources/ad_group_criterion.proto\x1a\x46google/ads/googleads/v16/resources/ad_group_criterion_customizer.proto\x1a\x41google/ads/googleads/v16/resources/ad_group_criterion_label.proto\x1a\x46google/ads/googleads/v16/resources/ad_group_criterion_simulation.proto\x1agoogle/ads/googleads/v16/resources/asset_field_type_view.proto\x1a\x34google/ads/googleads/v16/resources/asset_group.proto\x1a:google/ads/googleads/v16/resources/asset_group_asset.proto\x1aIgoogle/ads/googleads/v16/resources/asset_group_listing_group_filter.proto\x1aGgoogle/ads/googleads/v16/resources/asset_group_product_group_view.proto\x1a;google/ads/googleads/v16/resources/asset_group_signal.proto\x1aIgoogle/ads/googleads/v16/resources/asset_group_top_combination_view.proto\x1a\x32google/ads/googleads/v16/resources/asset_set.proto\x1a\x38google/ads/googleads/v16/resources/asset_set_asset.proto\x1agoogle/ads/googleads/v16/resources/campaign_bid_modifier.proto\x1a\x38google/ads/googleads/v16/resources/campaign_budget.proto\x1a\x41google/ads/googleads/v16/resources/campaign_conversion_goal.proto\x1a;google/ads/googleads/v16/resources/campaign_criterion.proto\x1agoogle/ads/googleads/v16/resources/conversion_value_rule.proto\x1a\x42google/ads/googleads/v16/resources/conversion_value_rule_set.proto\x1a:google/ads/googleads/v16/resources/currency_constant.proto\x1a\x38google/ads/googleads/v16/resources/custom_audience.proto\x1a?google/ads/googleads/v16/resources/custom_conversion_goal.proto\x1a\x38google/ads/googleads/v16/resources/custom_interest.proto\x1a\x31google/ads/googleads/v16/resources/customer.proto\x1a\x37google/ads/googleads/v16/resources/customer_asset.proto\x1a;google/ads/googleads/v16/resources/customer_asset_set.proto\x1a\x38google/ads/googleads/v16/resources/customer_client.proto\x1a=google/ads/googleads/v16/resources/customer_client_link.proto\x1a\x41google/ads/googleads/v16/resources/customer_conversion_goal.proto\x1agoogle/ads/googleads/v16/resources/customer_manager_link.proto\x1a\x44google/ads/googleads/v16/resources/customer_negative_criterion.proto\x1a\x45google/ads/googleads/v16/resources/customer_search_term_insight.proto\x1a=google/ads/googleads/v16/resources/customer_user_access.proto\x1aHgoogle/ads/googleads/v16/resources/customer_user_access_invitation.proto\x1a=google/ads/googleads/v16/resources/customizer_attribute.proto\x1a>google/ads/googleads/v16/resources/detail_placement_view.proto\x1a=google/ads/googleads/v16/resources/detailed_demographic.proto\x1a=google/ads/googleads/v16/resources/display_keyword_view.proto\x1a\x36google/ads/googleads/v16/resources/distance_view.proto\x1a\x38google/ads/googleads/v16/resources/domain_category.proto\x1aLgoogle/ads/googleads/v16/resources/dynamic_search_ads_search_term_view.proto\x1a\x43google/ads/googleads/v16/resources/expanded_landing_page_view.proto\x1a\x33google/ads/googleads/v16/resources/experiment.proto\x1a\x37google/ads/googleads/v16/resources/experiment_arm.proto\x1agoogle/ads/googleads/v16/resources/feed_placeholder_view.proto\x1a\x34google/ads/googleads/v16/resources/gender_view.proto\x1agoogle/ads/googleads/v16/resources/keyword_plan_ad_group.proto\x1a\x46google/ads/googleads/v16/resources/keyword_plan_ad_group_keyword.proto\x1a>google/ads/googleads/v16/resources/keyword_plan_campaign.proto\x1a\x46google/ads/googleads/v16/resources/keyword_plan_campaign_keyword.proto\x1a?google/ads/googleads/v16/resources/keyword_theme_constant.proto\x1a\x35google/ads/googleads/v16/resources/keyword_view.proto\x1a.google/ads/googleads/v16/resources/label.proto\x1a:google/ads/googleads/v16/resources/landing_page_view.proto\x1a:google/ads/googleads/v16/resources/language_constant.proto\x1a\x42google/ads/googleads/v16/resources/lead_form_submission_data.proto\x1a\x33google/ads/googleads/v16/resources/life_event.proto\x1a@google/ads/googleads/v16/resources/local_services_employee.proto\x1agoogle/ads/googleads/v16/resources/offline_user_data_job.proto\x1aJgoogle/ads/googleads/v16/resources/operating_system_version_constant.proto\x1a\x46google/ads/googleads/v16/resources/paid_organic_search_term_view.proto\x1a=google/ads/googleads/v16/resources/parental_status_view.proto\x1a\x37google/ads/googleads/v16/resources/per_store_view.proto\x1a\x42google/ads/googleads/v16/resources/product_category_constant.proto\x1a;google/ads/googleads/v16/resources/product_group_view.proto\x1a\x35google/ads/googleads/v16/resources/product_link.proto\x1a@google/ads/googleads/v16/resources/product_link_invitation.proto\x1agoogle/ads/googleads/v16/services/ad_group_asset_service.proto\x1a\x45google/ads/googleads/v16/services/ad_group_bid_modifier_service.proto\x1aMgoogle/ads/googleads/v16/services/ad_group_criterion_customizer_service.proto\x1aHgoogle/ads/googleads/v16/services/ad_group_criterion_label_service.proto\x1a\x42google/ads/googleads/v16/services/ad_group_criterion_service.proto\x1a\x43google/ads/googleads/v16/services/ad_group_customizer_service.proto\x1aJgoogle/ads/googleads/v16/services/ad_group_extension_setting_service.proto\x1a=google/ads/googleads/v16/services/ad_group_feed_service.proto\x1a>google/ads/googleads/v16/services/ad_group_label_service.proto\x1a\x38google/ads/googleads/v16/services/ad_group_service.proto\x1agoogle/ads/googleads/v16/services/campaign_asset_service.proto\x1a\x42google/ads/googleads/v16/services/campaign_asset_set_service.proto\x1a\x45google/ads/googleads/v16/services/campaign_bid_modifier_service.proto\x1a?google/ads/googleads/v16/services/campaign_budget_service.proto\x1aHgoogle/ads/googleads/v16/services/campaign_conversion_goal_service.proto\x1a\x42google/ads/googleads/v16/services/campaign_criterion_service.proto\x1a\x43google/ads/googleads/v16/services/campaign_customizer_service.proto\x1a>google/ads/googleads/v16/services/campaign_draft_service.proto\x1aJgoogle/ads/googleads/v16/services/campaign_extension_setting_service.proto\x1a=google/ads/googleads/v16/services/campaign_feed_service.proto\x1a>google/ads/googleads/v16/services/campaign_group_service.proto\x1a>google/ads/googleads/v16/services/campaign_label_service.proto\x1a\x38google/ads/googleads/v16/services/campaign_service.proto\x1a\x43google/ads/googleads/v16/services/campaign_shared_set_service.proto\x1a\x41google/ads/googleads/v16/services/conversion_action_service.proto\x1aJgoogle/ads/googleads/v16/services/conversion_custom_variable_service.proto\x1aOgoogle/ads/googleads/v16/services/conversion_goal_campaign_config_service.proto\x1a\x45google/ads/googleads/v16/services/conversion_value_rule_service.proto\x1aIgoogle/ads/googleads/v16/services/conversion_value_rule_set_service.proto\x1a\x46google/ads/googleads/v16/services/custom_conversion_goal_service.proto\x1a>google/ads/googleads/v16/services/customer_asset_service.proto\x1aHgoogle/ads/googleads/v16/services/customer_conversion_goal_service.proto\x1a\x43google/ads/googleads/v16/services/customer_customizer_service.proto\x1aJgoogle/ads/googleads/v16/services/customer_extension_setting_service.proto\x1a=google/ads/googleads/v16/services/customer_feed_service.proto\x1a>google/ads/googleads/v16/services/customer_label_service.proto\x1aKgoogle/ads/googleads/v16/services/customer_negative_criterion_service.proto\x1a\x38google/ads/googleads/v16/services/customer_service.proto\x1a\x44google/ads/googleads/v16/services/customizer_attribute_service.proto\x1a>google/ads/googleads/v16/services/experiment_arm_service.proto\x1a:google/ads/googleads/v16/services/experiment_service.proto\x1a\x43google/ads/googleads/v16/services/extension_feed_item_service.proto\x1a\x39google/ads/googleads/v16/services/feed_item_service.proto\x1a\x42google/ads/googleads/v16/services/feed_item_set_link_service.proto\x1a=google/ads/googleads/v16/services/feed_item_set_service.proto\x1a@google/ads/googleads/v16/services/feed_item_target_service.proto\x1a.google.ads.googleads.v16.resources.AdGroupCriterionCustomizer\x12[\n\x18\x61\x64_group_criterion_label\x18y \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.AdGroupCriterionLabel\x12\x65\n\x1d\x61\x64_group_criterion_simulation\x18n \x01(\x0b\x32>.google.ads.googleads.v16.resources.AdGroupCriterionSimulation\x12S\n\x13\x61\x64_group_customizer\x18\xb9\x01 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.AdGroupCustomizer\x12_\n\x1a\x61\x64_group_extension_setting\x18p \x01(\x0b\x32;.google.ads.googleads.v16.resources.AdGroupExtensionSetting\x12\x46\n\rad_group_feed\x18\x43 \x01(\x0b\x32/.google.ads.googleads.v16.resources.AdGroupFeed\x12H\n\x0e\x61\x64_group_label\x18s \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.AdGroupLabel\x12R\n\x13\x61\x64_group_simulation\x18k \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.AdGroupSimulation\x12\x46\n\x0c\x61\x64_parameter\x18\x82\x01 \x01(\x0b\x32/.google.ads.googleads.v16.resources.AdParameter\x12H\n\x0e\x61ge_range_view\x18\x30 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.AgeRangeView\x12L\n\x10\x61\x64_schedule_view\x18Y \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.AdScheduleView\x12K\n\x0f\x64omain_category\x18[ \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.DomainCategory\x12\x38\n\x05\x61sset\x18i \x01(\x0b\x32).google.ads.googleads.v16.resources.Asset\x12V\n\x15\x61sset_field_type_view\x18\xa8\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.AssetFieldTypeView\x12O\n\x11\x61sset_group_asset\x18\xad\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.AssetGroupAsset\x12Q\n\x12\x61sset_group_signal\x18\xbf\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.AssetGroupSignal\x12k\n asset_group_listing_group_filter\x18\xb6\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.AssetGroupListingGroupFilter\x12g\n\x1e\x61sset_group_product_group_view\x18\xbd\x01 \x01(\x0b\x32>.google.ads.googleads.v16.resources.AssetGroupProductGroupView\x12k\n asset_group_top_combination_view\x18\xc7\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.AssetGroupTopCombinationView\x12\x44\n\x0b\x61sset_group\x18\xac\x01 \x01(\x0b\x32..google.ads.googleads.v16.resources.AssetGroup\x12K\n\x0f\x61sset_set_asset\x18\xb4\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.AssetSetAsset\x12@\n\tasset_set\x18\xb3\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.AssetSet\x12R\n\x13\x61sset_set_type_view\x18\xc5\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.AssetSetTypeView\x12@\n\tbatch_job\x18\x8b\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.BatchJob\x12Y\n\x16\x62idding_data_exclusion\x18\x9f\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.BiddingDataExclusion\x12i\n\x1e\x62idding_seasonality_adjustment\x18\xa0\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.BiddingSeasonalityAdjustment\x12M\n\x10\x62idding_strategy\x18\x12 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.BiddingStrategy\x12\x63\n\x1b\x62idding_strategy_simulation\x18\x9e\x01 \x01(\x0b\x32=.google.ads.googleads.v16.resources.BiddingStrategySimulation\x12G\n\rbilling_setup\x18) \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.BillingSetup\x12@\n\tcall_view\x18\x98\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.CallView\x12K\n\x0f\x63\x61mpaign_budget\x18\x13 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CampaignBudget\x12>\n\x08\x63\x61mpaign\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.Campaign\x12J\n\x0e\x63\x61mpaign_asset\x18\x8e\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignAsset\x12Q\n\x12\x63\x61mpaign_asset_set\x18\xb5\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CampaignAssetSet\x12X\n\x16\x63\x61mpaign_audience_view\x18\x45 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.CampaignAudienceView\x12V\n\x15\x63\x61mpaign_bid_modifier\x18\x1a \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CampaignBidModifier\x12]\n\x18\x63\x61mpaign_conversion_goal\x18\xaf\x01 \x01(\x0b\x32:.google.ads.googleads.v16.resources.CampaignConversionGoal\x12Q\n\x12\x63\x61mpaign_criterion\x18\x14 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.CampaignCriterion\x12T\n\x13\x63\x61mpaign_customizer\x18\xba\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CampaignCustomizer\x12I\n\x0e\x63\x61mpaign_draft\x18\x31 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignDraft\x12`\n\x1a\x63\x61mpaign_extension_setting\x18q \x01(\x0b\x32<.google.ads.googleads.v16.resources.CampaignExtensionSetting\x12G\n\rcampaign_feed\x18? \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CampaignFeed\x12I\n\x0e\x63\x61mpaign_group\x18\x19 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignGroup\x12I\n\x0e\x63\x61mpaign_label\x18l \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CampaignLabel\x12[\n\x17\x63\x61mpaign_lifecycle_goal\x18\xd5\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.CampaignLifecycleGoal\x12\x64\n\x1c\x63\x61mpaign_search_term_insight\x18\xcc\x01 \x01(\x0b\x32=.google.ads.googleads.v16.resources.CampaignSearchTermInsight\x12R\n\x13\x63\x61mpaign_shared_set\x18\x1e \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.CampaignSharedSet\x12T\n\x13\x63\x61mpaign_simulation\x18\x9d\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CampaignSimulation\x12M\n\x10\x63\x61rrier_constant\x18\x42 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.CarrierConstant\x12\x46\n\x0c\x63hange_event\x18\x91\x01 \x01(\x0b\x32/.google.ads.googleads.v16.resources.ChangeEvent\x12G\n\rchange_status\x18% \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.ChangeStatus\x12P\n\x11\x63ombined_audience\x18\x94\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CombinedAudience\x12?\n\x08\x61udience\x18\xbe\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.Audience\x12O\n\x11\x63onversion_action\x18g \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.ConversionAction\x12\x61\n\x1a\x63onversion_custom_variable\x18\x99\x01 \x01(\x0b\x32<.google.ads.googleads.v16.resources.ConversionCustomVariable\x12j\n\x1f\x63onversion_goal_campaign_config\x18\xb1\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.ConversionGoalCampaignConfig\x12W\n\x15\x63onversion_value_rule\x18\xa4\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.ConversionValueRule\x12^\n\x19\x63onversion_value_rule_set\x18\xa5\x01 \x01(\x0b\x32:.google.ads.googleads.v16.resources.ConversionValueRuleSet\x12\x41\n\nclick_view\x18z \x01(\x0b\x32-.google.ads.googleads.v16.resources.ClickView\x12P\n\x11\x63urrency_constant\x18\x86\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CurrencyConstant\x12L\n\x0f\x63ustom_audience\x18\x93\x01 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CustomAudience\x12Y\n\x16\x63ustom_conversion_goal\x18\xb0\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.CustomConversionGoal\x12K\n\x0f\x63ustom_interest\x18h \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CustomInterest\x12>\n\x08\x63ustomer\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.Customer\x12J\n\x0e\x63ustomer_asset\x18\x9b\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CustomerAsset\x12Q\n\x12\x63ustomer_asset_set\x18\xc3\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.CustomerAssetSet\x12\x63\n\x1b\x61\x63\x63\x65ssible_bidding_strategy\x18\xa9\x01 \x01(\x0b\x32=.google.ads.googleads.v16.resources.AccessibleBiddingStrategy\x12T\n\x13\x63ustomer_customizer\x18\xb8\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CustomerCustomizer\x12V\n\x15\x63ustomer_manager_link\x18= \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CustomerManagerLink\x12T\n\x14\x63ustomer_client_link\x18> \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CustomerClientLink\x12K\n\x0f\x63ustomer_client\x18\x46 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.CustomerClient\x12]\n\x18\x63ustomer_conversion_goal\x18\xae\x01 \x01(\x0b\x32:.google.ads.googleads.v16.resources.CustomerConversionGoal\x12`\n\x1a\x63ustomer_extension_setting\x18r \x01(\x0b\x32<.google.ads.googleads.v16.resources.CustomerExtensionSetting\x12G\n\rcustomer_feed\x18@ \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.CustomerFeed\x12I\n\x0e\x63ustomer_label\x18| \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.CustomerLabel\x12[\n\x17\x63ustomer_lifecycle_goal\x18\xd4\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.CustomerLifecycleGoal\x12\x62\n\x1b\x63ustomer_negative_criterion\x18X \x01(\x0b\x32=.google.ads.googleads.v16.resources.CustomerNegativeCriterion\x12\x64\n\x1c\x63ustomer_search_term_insight\x18\xcd\x01 \x01(\x0b\x32=.google.ads.googleads.v16.resources.CustomerSearchTermInsight\x12U\n\x14\x63ustomer_user_access\x18\x92\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.CustomerUserAccess\x12j\n\x1f\x63ustomer_user_access_invitation\x18\x96\x01 \x01(\x0b\x32@.google.ads.googleads.v16.resources.CustomerUserAccessInvitation\x12V\n\x14\x63ustomizer_attribute\x18\xb2\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.CustomizerAttribute\x12V\n\x15\x64\x65tail_placement_view\x18v \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.DetailPlacementView\x12V\n\x14\x64\x65tailed_demographic\x18\xa6\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.DetailedDemographic\x12T\n\x14\x64isplay_keyword_view\x18/ \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.DisplayKeywordView\x12H\n\rdistance_view\x18\x84\x01 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.DistanceView\x12o\n#dynamic_search_ads_search_term_view\x18j \x01(\x0b\x32\x42.google.ads.googleads.v16.resources.DynamicSearchAdsSearchTermView\x12`\n\x1a\x65xpanded_landing_page_view\x18\x80\x01 \x01(\x0b\x32;.google.ads.googleads.v16.resources.ExpandedLandingPageView\x12R\n\x13\x65xtension_feed_item\x18U \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.ExtensionFeedItem\x12\x36\n\x04\x66\x65\x65\x64\x18. \x01(\x0b\x32(.google.ads.googleads.v16.resources.Feed\x12?\n\tfeed_item\x18\x32 \x01(\x0b\x32,.google.ads.googleads.v16.resources.FeedItem\x12G\n\rfeed_item_set\x18\x95\x01 \x01(\x0b\x32/.google.ads.googleads.v16.resources.FeedItemSet\x12P\n\x12\x66\x65\x65\x64_item_set_link\x18\x97\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.FeedItemSetLink\x12L\n\x10\x66\x65\x65\x64_item_target\x18t \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.FeedItemTarget\x12\x45\n\x0c\x66\x65\x65\x64_mapping\x18: \x01(\x0b\x32/.google.ads.googleads.v16.resources.FeedMapping\x12V\n\x15\x66\x65\x65\x64_placeholder_view\x18\x61 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.FeedPlaceholderView\x12\x43\n\x0bgender_view\x18( \x01(\x0b\x32..google.ads.googleads.v16.resources.GenderView\x12R\n\x13geo_target_constant\x18\x17 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.GeoTargetConstant\x12K\n\x0fgeographic_view\x18} \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.GeographicView\x12T\n\x14group_placement_view\x18w \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.GroupPlacementView\x12L\n\x10hotel_group_view\x18\x33 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.HotelGroupView\x12X\n\x16hotel_performance_view\x18G \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.HotelPerformanceView\x12V\n\x14hotel_reconciliation\x18\xbc\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.HotelReconciliation\x12O\n\x11income_range_view\x18\x8a\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.IncomeRangeView\x12\x45\n\x0ckeyword_view\x18\x15 \x01(\x0b\x32/.google.ads.googleads.v16.resources.KeywordView\x12\x45\n\x0ckeyword_plan\x18 \x01(\x0b\x32/.google.ads.googleads.v16.resources.KeywordPlan\x12V\n\x15keyword_plan_campaign\x18! \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.KeywordPlanCampaign\x12\x66\n\x1dkeyword_plan_campaign_keyword\x18\x8c\x01 \x01(\x0b\x32>.google.ads.googleads.v16.resources.KeywordPlanCampaignKeyword\x12U\n\x15keyword_plan_ad_group\x18# \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.KeywordPlanAdGroup\x12\x65\n\x1dkeyword_plan_ad_group_keyword\x18\x8d\x01 \x01(\x0b\x32=.google.ads.googleads.v16.resources.KeywordPlanAdGroupKeyword\x12Y\n\x16keyword_theme_constant\x18\xa3\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.KeywordThemeConstant\x12\x38\n\x05label\x18\x34 \x01(\x0b\x32).google.ads.googleads.v16.resources.Label\x12N\n\x11landing_page_view\x18~ \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.LandingPageView\x12O\n\x11language_constant\x18\x37 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.LanguageConstant\x12G\n\rlocation_view\x18{ \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.LocationView\x12X\n\x16managed_placement_view\x18\x35 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.ManagedPlacementView\x12\x41\n\nmedia_file\x18Z \x01(\x0b\x32-.google.ads.googleads.v16.resources.MediaFile\x12[\n\x17local_services_employee\x18\xdf\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.LocalServicesEmployee\x12t\n$local_services_verification_artifact\x18\xd3\x01 \x01(\x0b\x32\x45.google.ads.googleads.v16.resources.LocalServicesVerificationArtifact\x12\x63\n\x1cmobile_app_category_constant\x18W \x01(\x0b\x32=.google.ads.googleads.v16.resources.MobileAppCategoryConstant\x12X\n\x16mobile_device_constant\x18\x62 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.MobileDeviceConstant\x12{\n(offline_conversion_upload_client_summary\x18\xd8\x01 \x01(\x0b\x32H.google.ads.googleads.v16.resources.OfflineConversionUploadClientSummary\x12V\n\x15offline_user_data_job\x18\x89\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.OfflineUserDataJob\x12m\n!operating_system_version_constant\x18V \x01(\x0b\x32\x42.google.ads.googleads.v16.resources.OperatingSystemVersionConstant\x12\x65\n\x1dpaid_organic_search_term_view\x18\x81\x01 \x01(\x0b\x32=.google.ads.googleads.v16.resources.PaidOrganicSearchTermView\x12T\n\x13qualifying_question\x18\xca\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.QualifyingQuestion\x12T\n\x14parental_status_view\x18- \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.ParentalStatusView\x12I\n\x0eper_store_view\x18\xc6\x01 \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.PerStoreView\x12_\n\x19product_category_constant\x18\xd0\x01 \x01(\x0b\x32;.google.ads.googleads.v16.resources.ProductCategoryConstant\x12P\n\x12product_group_view\x18\x36 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.ProductGroupView\x12\x46\n\x0cproduct_link\x18\xc2\x01 \x01(\x0b\x32/.google.ads.googleads.v16.resources.ProductLink\x12[\n\x17product_link_invitation\x18\xd1\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.ProductLinkInvitation\x12J\n\x0erecommendation\x18\x16 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.Recommendation\x12\x64\n\x1brecommendation_subscription\x18\xdc\x01 \x01(\x0b\x32>.google.ads.googleads.v16.resources.RecommendationSubscription\x12L\n\x10search_term_view\x18\x44 \x01(\x0b\x32\x32.google.ads.googleads.v16.resources.SearchTermView\x12M\n\x10shared_criterion\x18\x1d \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.SharedCriterion\x12\x41\n\nshared_set\x18\x1b \x01(\x0b\x32-.google.ads.googleads.v16.resources.SharedSet\x12Y\n\x16smart_campaign_setting\x18\xa7\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.SmartCampaignSetting\x12^\n\x19shopping_performance_view\x18u \x01(\x0b\x32;.google.ads.googleads.v16.resources.ShoppingPerformanceView\x12i\n\x1fsmart_campaign_search_term_view\x18\xaa\x01 \x01(\x0b\x32?.google.ads.googleads.v16.resources.SmartCampaignSearchTermView\x12g\n\x1ethird_party_app_analytics_link\x18\x90\x01 \x01(\x0b\x32>.google.ads.googleads.v16.resources.ThirdPartyAppAnalyticsLink\x12\x41\n\ntopic_view\x18, \x01(\x0b\x32-.google.ads.googleads.v16.resources.TopicView\x12`\n\x1atravel_activity_group_view\x18\xc9\x01 \x01(\x0b\x32;.google.ads.googleads.v16.resources.TravelActivityGroupView\x12l\n travel_activity_performance_view\x18\xc8\x01 \x01(\x0b\x32\x41.google.ads.googleads.v16.resources.TravelActivityPerformanceView\x12\x43\n\nexperiment\x18\x85\x01 \x01(\x0b\x32..google.ads.googleads.v16.resources.Experiment\x12J\n\x0e\x65xperiment_arm\x18\xb7\x01 \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.ExperimentArm\x12G\n\ruser_interest\x18; \x01(\x0b\x32\x30.google.ads.googleads.v16.resources.UserInterest\x12\x42\n\nlife_event\x18\xa1\x01 \x01(\x0b\x32-.google.ads.googleads.v16.resources.LifeEvent\x12?\n\tuser_list\x18& \x01(\x0b\x32,.google.ads.googleads.v16.resources.UserList\x12Q\n\x12user_location_view\x18\x87\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.resources.UserLocationView\x12Q\n\x12remarketing_action\x18< \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.RemarketingAction\x12I\n\x0etopic_constant\x18\x1f \x01(\x0b\x32\x31.google.ads.googleads.v16.resources.TopicConstant\x12\x38\n\x05video\x18\' \x01(\x0b\x32).google.ads.googleads.v16.resources.Video\x12\x46\n\x0cwebpage_view\x18\xa2\x01 \x01(\x0b\x32/.google.ads.googleads.v16.resources.WebpageView\x12^\n\x19lead_form_submission_data\x18\xc0\x01 \x01(\x0b\x32:.google.ads.googleads.v16.resources.LeadFormSubmissionData\x12S\n\x13local_services_lead\x18\xd2\x01 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.LocalServicesLead\x12l\n local_services_lead_conversation\x18\xd6\x01 \x01(\x0b\x32\x41.google.ads.googleads.v16.resources.LocalServicesLeadConversation\x12}\n*android_privacy_shared_key_google_ad_group\x18\xd9\x01 \x01(\x0b\x32H.google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleAdGroup\x12~\n*android_privacy_shared_key_google_campaign\x18\xda\x01 \x01(\x0b\x32I.google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleCampaign\x12\x85\x01\n.android_privacy_shared_key_google_network_type\x18\xdb\x01 \x01(\x0b\x32L.google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleNetworkType\x12\x39\n\x07metrics\x18\x04 \x01(\x0b\x32(.google.ads.googleads.v16.common.Metrics\x12;\n\x08segments\x18\x66 \x01(\x0b\x32).google.ads.googleads.v16.common.Segments\"\xa2\x02\n\x16MutateGoogleAdsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\x11mutate_operations\x18\x02 \x03(\x0b\x32\x32.google.ads.googleads.v16.services.MutateOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xac\x01\n\x17MutateGoogleAdsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12^\n\x1amutate_operation_responses\x18\x01 \x03(\x0b\x32:.google.ads.googleads.v16.services.MutateOperationResponse\"\xa4;\n\x0fMutateOperation\x12\x61\n\x1b\x61\x64_group_ad_label_operation\x18\x11 \x01(\x0b\x32:.google.ads.googleads.v16.services.AdGroupAdLabelOperationH\x00\x12V\n\x15\x61\x64_group_ad_operation\x18\x01 \x01(\x0b\x32\x35.google.ads.googleads.v16.services.AdGroupAdOperationH\x00\x12\\\n\x18\x61\x64_group_asset_operation\x18\x38 \x01(\x0b\x32\x38.google.ads.googleads.v16.services.AdGroupAssetOperationH\x00\x12i\n\x1f\x61\x64_group_bid_modifier_operation\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.services.AdGroupBidModifierOperationH\x00\x12y\n\'ad_group_criterion_customizer_operation\x18M \x01(\x0b\x32\x46.google.ads.googleads.v16.services.AdGroupCriterionCustomizerOperationH\x00\x12o\n\"ad_group_criterion_label_operation\x18\x12 \x01(\x0b\x32\x41.google.ads.googleads.v16.services.AdGroupCriterionLabelOperationH\x00\x12\x64\n\x1c\x61\x64_group_criterion_operation\x18\x03 \x01(\x0b\x32<.google.ads.googleads.v16.services.AdGroupCriterionOperationH\x00\x12\x66\n\x1d\x61\x64_group_customizer_operation\x18K \x01(\x0b\x32=.google.ads.googleads.v16.services.AdGroupCustomizerOperationH\x00\x12s\n$ad_group_extension_setting_operation\x18\x13 \x01(\x0b\x32\x43.google.ads.googleads.v16.services.AdGroupExtensionSettingOperationH\x00\x12Z\n\x17\x61\x64_group_feed_operation\x18\x14 \x01(\x0b\x32\x37.google.ads.googleads.v16.services.AdGroupFeedOperationH\x00\x12\\\n\x18\x61\x64_group_label_operation\x18\x15 \x01(\x0b\x32\x38.google.ads.googleads.v16.services.AdGroupLabelOperationH\x00\x12Q\n\x12\x61\x64_group_operation\x18\x05 \x01(\x0b\x32\x33.google.ads.googleads.v16.services.AdGroupOperationH\x00\x12\x46\n\x0c\x61\x64_operation\x18\x31 \x01(\x0b\x32..google.ads.googleads.v16.services.AdOperationH\x00\x12Y\n\x16\x61\x64_parameter_operation\x18\x16 \x01(\x0b\x32\x37.google.ads.googleads.v16.services.AdParameterOperationH\x00\x12L\n\x0f\x61sset_operation\x18\x17 \x01(\x0b\x32\x31.google.ads.googleads.v16.services.AssetOperationH\x00\x12\x62\n\x1b\x61sset_group_asset_operation\x18\x41 \x01(\x0b\x32;.google.ads.googleads.v16.services.AssetGroupAssetOperationH\x00\x12~\n*asset_group_listing_group_filter_operation\x18N \x01(\x0b\x32H.google.ads.googleads.v16.services.AssetGroupListingGroupFilterOperationH\x00\x12\x64\n\x1c\x61sset_group_signal_operation\x18P \x01(\x0b\x32<.google.ads.googleads.v16.services.AssetGroupSignalOperationH\x00\x12W\n\x15\x61sset_group_operation\x18> \x01(\x0b\x32\x36.google.ads.googleads.v16.services.AssetGroupOperationH\x00\x12^\n\x19\x61sset_set_asset_operation\x18G \x01(\x0b\x32\x39.google.ads.googleads.v16.services.AssetSetAssetOperationH\x00\x12S\n\x13\x61sset_set_operation\x18H \x01(\x0b\x32\x34.google.ads.googleads.v16.services.AssetSetOperationH\x00\x12R\n\x12\x61udience_operation\x18Q \x01(\x0b\x32\x34.google.ads.googleads.v16.services.AudienceOperationH\x00\x12l\n bidding_data_exclusion_operation\x18: \x01(\x0b\x32@.google.ads.googleads.v16.services.BiddingDataExclusionOperationH\x00\x12|\n(bidding_seasonality_adjustment_operation\x18; \x01(\x0b\x32H.google.ads.googleads.v16.services.BiddingSeasonalityAdjustmentOperationH\x00\x12\x61\n\x1a\x62idding_strategy_operation\x18\x06 \x01(\x0b\x32;.google.ads.googleads.v16.services.BiddingStrategyOperationH\x00\x12]\n\x18\x63\x61mpaign_asset_operation\x18\x34 \x01(\x0b\x32\x39.google.ads.googleads.v16.services.CampaignAssetOperationH\x00\x12\x64\n\x1c\x63\x61mpaign_asset_set_operation\x18I \x01(\x0b\x32<.google.ads.googleads.v16.services.CampaignAssetSetOperationH\x00\x12j\n\x1f\x63\x61mpaign_bid_modifier_operation\x18\x07 \x01(\x0b\x32?.google.ads.googleads.v16.services.CampaignBidModifierOperationH\x00\x12_\n\x19\x63\x61mpaign_budget_operation\x18\x08 \x01(\x0b\x32:.google.ads.googleads.v16.services.CampaignBudgetOperationH\x00\x12p\n\"campaign_conversion_goal_operation\x18\x43 \x01(\x0b\x32\x42.google.ads.googleads.v16.services.CampaignConversionGoalOperationH\x00\x12\x65\n\x1c\x63\x61mpaign_criterion_operation\x18\r \x01(\x0b\x32=.google.ads.googleads.v16.services.CampaignCriterionOperationH\x00\x12g\n\x1d\x63\x61mpaign_customizer_operation\x18L \x01(\x0b\x32>.google.ads.googleads.v16.services.CampaignCustomizerOperationH\x00\x12]\n\x18\x63\x61mpaign_draft_operation\x18\x18 \x01(\x0b\x32\x39.google.ads.googleads.v16.services.CampaignDraftOperationH\x00\x12t\n$campaign_extension_setting_operation\x18\x1a \x01(\x0b\x32\x44.google.ads.googleads.v16.services.CampaignExtensionSettingOperationH\x00\x12[\n\x17\x63\x61mpaign_feed_operation\x18\x1b \x01(\x0b\x32\x38.google.ads.googleads.v16.services.CampaignFeedOperationH\x00\x12]\n\x18\x63\x61mpaign_group_operation\x18\t \x01(\x0b\x32\x39.google.ads.googleads.v16.services.CampaignGroupOperationH\x00\x12]\n\x18\x63\x61mpaign_label_operation\x18\x1c \x01(\x0b\x32\x39.google.ads.googleads.v16.services.CampaignLabelOperationH\x00\x12R\n\x12\x63\x61mpaign_operation\x18\n \x01(\x0b\x32\x34.google.ads.googleads.v16.services.CampaignOperationH\x00\x12\x66\n\x1d\x63\x61mpaign_shared_set_operation\x18\x0b \x01(\x0b\x32=.google.ads.googleads.v16.services.CampaignSharedSetOperationH\x00\x12\x63\n\x1b\x63onversion_action_operation\x18\x0c \x01(\x0b\x32<.google.ads.googleads.v16.services.ConversionActionOperationH\x00\x12t\n$conversion_custom_variable_operation\x18\x37 \x01(\x0b\x32\x44.google.ads.googleads.v16.services.ConversionCustomVariableOperationH\x00\x12}\n)conversion_goal_campaign_config_operation\x18\x45 \x01(\x0b\x32H.google.ads.googleads.v16.services.ConversionGoalCampaignConfigOperationH\x00\x12j\n\x1f\x63onversion_value_rule_operation\x18? \x01(\x0b\x32?.google.ads.googleads.v16.services.ConversionValueRuleOperationH\x00\x12q\n#conversion_value_rule_set_operation\x18@ \x01(\x0b\x32\x42.google.ads.googleads.v16.services.ConversionValueRuleSetOperationH\x00\x12l\n custom_conversion_goal_operation\x18\x44 \x01(\x0b\x32@.google.ads.googleads.v16.services.CustomConversionGoalOperationH\x00\x12]\n\x18\x63ustomer_asset_operation\x18\x39 \x01(\x0b\x32\x39.google.ads.googleads.v16.services.CustomerAssetOperationH\x00\x12p\n\"customer_conversion_goal_operation\x18\x42 \x01(\x0b\x32\x42.google.ads.googleads.v16.services.CustomerConversionGoalOperationH\x00\x12g\n\x1d\x63ustomer_customizer_operation\x18O \x01(\x0b\x32>.google.ads.googleads.v16.services.CustomerCustomizerOperationH\x00\x12t\n$customer_extension_setting_operation\x18\x1e \x01(\x0b\x32\x44.google.ads.googleads.v16.services.CustomerExtensionSettingOperationH\x00\x12[\n\x17\x63ustomer_feed_operation\x18\x1f \x01(\x0b\x32\x38.google.ads.googleads.v16.services.CustomerFeedOperationH\x00\x12]\n\x18\x63ustomer_label_operation\x18 \x01(\x0b\x32\x39.google.ads.googleads.v16.services.CustomerLabelOperationH\x00\x12v\n%customer_negative_criterion_operation\x18\" \x01(\x0b\x32\x45.google.ads.googleads.v16.services.CustomerNegativeCriterionOperationH\x00\x12R\n\x12\x63ustomer_operation\x18# \x01(\x0b\x32\x34.google.ads.googleads.v16.services.CustomerOperationH\x00\x12i\n\x1e\x63ustomizer_attribute_operation\x18\x46 \x01(\x0b\x32?.google.ads.googleads.v16.services.CustomizerAttributeOperationH\x00\x12V\n\x14\x65xperiment_operation\x18R \x01(\x0b\x32\x36.google.ads.googleads.v16.services.ExperimentOperationH\x00\x12]\n\x18\x65xperiment_arm_operation\x18S \x01(\x0b\x32\x39.google.ads.googleads.v16.services.ExperimentArmOperationH\x00\x12\x66\n\x1d\x65xtension_feed_item_operation\x18$ \x01(\x0b\x32=.google.ads.googleads.v16.services.ExtensionFeedItemOperationH\x00\x12S\n\x13\x66\x65\x65\x64_item_operation\x18% \x01(\x0b\x32\x34.google.ads.googleads.v16.services.FeedItemOperationH\x00\x12Z\n\x17\x66\x65\x65\x64_item_set_operation\x18\x35 \x01(\x0b\x32\x37.google.ads.googleads.v16.services.FeedItemSetOperationH\x00\x12\x63\n\x1c\x66\x65\x65\x64_item_set_link_operation\x18\x36 \x01(\x0b\x32;.google.ads.googleads.v16.services.FeedItemSetLinkOperationH\x00\x12`\n\x1a\x66\x65\x65\x64_item_target_operation\x18& \x01(\x0b\x32:.google.ads.googleads.v16.services.FeedItemTargetOperationH\x00\x12Y\n\x16\x66\x65\x65\x64_mapping_operation\x18\' \x01(\x0b\x32\x37.google.ads.googleads.v16.services.FeedMappingOperationH\x00\x12J\n\x0e\x66\x65\x65\x64_operation\x18( \x01(\x0b\x32\x30.google.ads.googleads.v16.services.FeedOperationH\x00\x12i\n\x1fkeyword_plan_ad_group_operation\x18, \x01(\x0b\x32>.google.ads.googleads.v16.services.KeywordPlanAdGroupOperationH\x00\x12x\n\'keyword_plan_ad_group_keyword_operation\x18\x32 \x01(\x0b\x32\x45.google.ads.googleads.v16.services.KeywordPlanAdGroupKeywordOperationH\x00\x12y\n\'keyword_plan_campaign_keyword_operation\x18\x33 \x01(\x0b\x32\x46.google.ads.googleads.v16.services.KeywordPlanCampaignKeywordOperationH\x00\x12j\n\x1fkeyword_plan_campaign_operation\x18- \x01(\x0b\x32?.google.ads.googleads.v16.services.KeywordPlanCampaignOperationH\x00\x12Y\n\x16keyword_plan_operation\x18\x30 \x01(\x0b\x32\x37.google.ads.googleads.v16.services.KeywordPlanOperationH\x00\x12L\n\x0flabel_operation\x18) \x01(\x0b\x32\x31.google.ads.googleads.v16.services.LabelOperationH\x00\x12w\n%recommendation_subscription_operation\x18V \x01(\x0b\x32\x46.google.ads.googleads.v16.services.RecommendationSubscriptionOperationH\x00\x12\x65\n\x1cremarketing_action_operation\x18+ \x01(\x0b\x32=.google.ads.googleads.v16.services.RemarketingActionOperationH\x00\x12\x61\n\x1ashared_criterion_operation\x18\x0e \x01(\x0b\x32;.google.ads.googleads.v16.services.SharedCriterionOperationH\x00\x12U\n\x14shared_set_operation\x18\x0f \x01(\x0b\x32\x35.google.ads.googleads.v16.services.SharedSetOperationH\x00\x12l\n smart_campaign_setting_operation\x18= \x01(\x0b\x32@.google.ads.googleads.v16.services.SmartCampaignSettingOperationH\x00\x12S\n\x13user_list_operation\x18\x10 \x01(\x0b\x32\x34.google.ads.googleads.v16.services.UserListOperationH\x00\x42\x0b\n\toperation\"\xad;\n\x17MutateOperationResponse\x12\x61\n\x18\x61\x64_group_ad_label_result\x18\x11 \x01(\x0b\x32=.google.ads.googleads.v16.services.MutateAdGroupAdLabelResultH\x00\x12V\n\x12\x61\x64_group_ad_result\x18\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.services.MutateAdGroupAdResultH\x00\x12\\\n\x15\x61\x64_group_asset_result\x18\x38 \x01(\x0b\x32;.google.ads.googleads.v16.services.MutateAdGroupAssetResultH\x00\x12i\n\x1c\x61\x64_group_bid_modifier_result\x18\x02 \x01(\x0b\x32\x41.google.ads.googleads.v16.services.MutateAdGroupBidModifierResultH\x00\x12y\n$ad_group_criterion_customizer_result\x18M \x01(\x0b\x32I.google.ads.googleads.v16.services.MutateAdGroupCriterionCustomizerResultH\x00\x12o\n\x1f\x61\x64_group_criterion_label_result\x18\x12 \x01(\x0b\x32\x44.google.ads.googleads.v16.services.MutateAdGroupCriterionLabelResultH\x00\x12\x64\n\x19\x61\x64_group_criterion_result\x18\x03 \x01(\x0b\x32?.google.ads.googleads.v16.services.MutateAdGroupCriterionResultH\x00\x12\x66\n\x1a\x61\x64_group_customizer_result\x18K \x01(\x0b\x32@.google.ads.googleads.v16.services.MutateAdGroupCustomizerResultH\x00\x12s\n!ad_group_extension_setting_result\x18\x13 \x01(\x0b\x32\x46.google.ads.googleads.v16.services.MutateAdGroupExtensionSettingResultH\x00\x12Z\n\x14\x61\x64_group_feed_result\x18\x14 \x01(\x0b\x32:.google.ads.googleads.v16.services.MutateAdGroupFeedResultH\x00\x12\\\n\x15\x61\x64_group_label_result\x18\x15 \x01(\x0b\x32;.google.ads.googleads.v16.services.MutateAdGroupLabelResultH\x00\x12Q\n\x0f\x61\x64_group_result\x18\x05 \x01(\x0b\x32\x36.google.ads.googleads.v16.services.MutateAdGroupResultH\x00\x12Y\n\x13\x61\x64_parameter_result\x18\x16 \x01(\x0b\x32:.google.ads.googleads.v16.services.MutateAdParameterResultH\x00\x12\x46\n\tad_result\x18\x31 \x01(\x0b\x32\x31.google.ads.googleads.v16.services.MutateAdResultH\x00\x12L\n\x0c\x61sset_result\x18\x17 \x01(\x0b\x32\x34.google.ads.googleads.v16.services.MutateAssetResultH\x00\x12\x62\n\x18\x61sset_group_asset_result\x18\x41 \x01(\x0b\x32>.google.ads.googleads.v16.services.MutateAssetGroupAssetResultH\x00\x12~\n\'asset_group_listing_group_filter_result\x18N \x01(\x0b\x32K.google.ads.googleads.v16.services.MutateAssetGroupListingGroupFilterResultH\x00\x12\x64\n\x19\x61sset_group_signal_result\x18O \x01(\x0b\x32?.google.ads.googleads.v16.services.MutateAssetGroupSignalResultH\x00\x12W\n\x12\x61sset_group_result\x18> \x01(\x0b\x32\x39.google.ads.googleads.v16.services.MutateAssetGroupResultH\x00\x12^\n\x16\x61sset_set_asset_result\x18G \x01(\x0b\x32<.google.ads.googleads.v16.services.MutateAssetSetAssetResultH\x00\x12S\n\x10\x61sset_set_result\x18H \x01(\x0b\x32\x37.google.ads.googleads.v16.services.MutateAssetSetResultH\x00\x12R\n\x0f\x61udience_result\x18P \x01(\x0b\x32\x37.google.ads.googleads.v16.services.MutateAudienceResultH\x00\x12m\n\x1d\x62idding_data_exclusion_result\x18: \x01(\x0b\x32\x44.google.ads.googleads.v16.services.MutateBiddingDataExclusionsResultH\x00\x12}\n%bidding_seasonality_adjustment_result\x18; \x01(\x0b\x32L.google.ads.googleads.v16.services.MutateBiddingSeasonalityAdjustmentsResultH\x00\x12\x61\n\x17\x62idding_strategy_result\x18\x06 \x01(\x0b\x32>.google.ads.googleads.v16.services.MutateBiddingStrategyResultH\x00\x12]\n\x15\x63\x61mpaign_asset_result\x18\x34 \x01(\x0b\x32<.google.ads.googleads.v16.services.MutateCampaignAssetResultH\x00\x12\x64\n\x19\x63\x61mpaign_asset_set_result\x18I \x01(\x0b\x32?.google.ads.googleads.v16.services.MutateCampaignAssetSetResultH\x00\x12j\n\x1c\x63\x61mpaign_bid_modifier_result\x18\x07 \x01(\x0b\x32\x42.google.ads.googleads.v16.services.MutateCampaignBidModifierResultH\x00\x12_\n\x16\x63\x61mpaign_budget_result\x18\x08 \x01(\x0b\x32=.google.ads.googleads.v16.services.MutateCampaignBudgetResultH\x00\x12p\n\x1f\x63\x61mpaign_conversion_goal_result\x18\x43 \x01(\x0b\x32\x45.google.ads.googleads.v16.services.MutateCampaignConversionGoalResultH\x00\x12\x65\n\x19\x63\x61mpaign_criterion_result\x18\r \x01(\x0b\x32@.google.ads.googleads.v16.services.MutateCampaignCriterionResultH\x00\x12g\n\x1a\x63\x61mpaign_customizer_result\x18L \x01(\x0b\x32\x41.google.ads.googleads.v16.services.MutateCampaignCustomizerResultH\x00\x12]\n\x15\x63\x61mpaign_draft_result\x18\x18 \x01(\x0b\x32<.google.ads.googleads.v16.services.MutateCampaignDraftResultH\x00\x12t\n!campaign_extension_setting_result\x18\x1a \x01(\x0b\x32G.google.ads.googleads.v16.services.MutateCampaignExtensionSettingResultH\x00\x12[\n\x14\x63\x61mpaign_feed_result\x18\x1b \x01(\x0b\x32;.google.ads.googleads.v16.services.MutateCampaignFeedResultH\x00\x12]\n\x15\x63\x61mpaign_group_result\x18\t \x01(\x0b\x32<.google.ads.googleads.v16.services.MutateCampaignGroupResultH\x00\x12]\n\x15\x63\x61mpaign_label_result\x18\x1c \x01(\x0b\x32<.google.ads.googleads.v16.services.MutateCampaignLabelResultH\x00\x12R\n\x0f\x63\x61mpaign_result\x18\n \x01(\x0b\x32\x37.google.ads.googleads.v16.services.MutateCampaignResultH\x00\x12\x66\n\x1a\x63\x61mpaign_shared_set_result\x18\x0b \x01(\x0b\x32@.google.ads.googleads.v16.services.MutateCampaignSharedSetResultH\x00\x12\x63\n\x18\x63onversion_action_result\x18\x0c \x01(\x0b\x32?.google.ads.googleads.v16.services.MutateConversionActionResultH\x00\x12t\n!conversion_custom_variable_result\x18\x37 \x01(\x0b\x32G.google.ads.googleads.v16.services.MutateConversionCustomVariableResultH\x00\x12}\n&conversion_goal_campaign_config_result\x18\x45 \x01(\x0b\x32K.google.ads.googleads.v16.services.MutateConversionGoalCampaignConfigResultH\x00\x12j\n\x1c\x63onversion_value_rule_result\x18? \x01(\x0b\x32\x42.google.ads.googleads.v16.services.MutateConversionValueRuleResultH\x00\x12q\n conversion_value_rule_set_result\x18@ \x01(\x0b\x32\x45.google.ads.googleads.v16.services.MutateConversionValueRuleSetResultH\x00\x12l\n\x1d\x63ustom_conversion_goal_result\x18\x44 \x01(\x0b\x32\x43.google.ads.googleads.v16.services.MutateCustomConversionGoalResultH\x00\x12]\n\x15\x63ustomer_asset_result\x18\x39 \x01(\x0b\x32<.google.ads.googleads.v16.services.MutateCustomerAssetResultH\x00\x12p\n\x1f\x63ustomer_conversion_goal_result\x18\x42 \x01(\x0b\x32\x45.google.ads.googleads.v16.services.MutateCustomerConversionGoalResultH\x00\x12g\n\x1a\x63ustomer_customizer_result\x18J \x01(\x0b\x32\x41.google.ads.googleads.v16.services.MutateCustomerCustomizerResultH\x00\x12t\n!customer_extension_setting_result\x18\x1e \x01(\x0b\x32G.google.ads.googleads.v16.services.MutateCustomerExtensionSettingResultH\x00\x12[\n\x14\x63ustomer_feed_result\x18\x1f \x01(\x0b\x32;.google.ads.googleads.v16.services.MutateCustomerFeedResultH\x00\x12]\n\x15\x63ustomer_label_result\x18 \x01(\x0b\x32<.google.ads.googleads.v16.services.MutateCustomerLabelResultH\x00\x12u\n\"customer_negative_criterion_result\x18\" \x01(\x0b\x32G.google.ads.googleads.v16.services.MutateCustomerNegativeCriteriaResultH\x00\x12R\n\x0f\x63ustomer_result\x18# \x01(\x0b\x32\x37.google.ads.googleads.v16.services.MutateCustomerResultH\x00\x12i\n\x1b\x63ustomizer_attribute_result\x18\x46 \x01(\x0b\x32\x42.google.ads.googleads.v16.services.MutateCustomizerAttributeResultH\x00\x12V\n\x11\x65xperiment_result\x18Q \x01(\x0b\x32\x39.google.ads.googleads.v16.services.MutateExperimentResultH\x00\x12]\n\x15\x65xperiment_arm_result\x18R \x01(\x0b\x32<.google.ads.googleads.v16.services.MutateExperimentArmResultH\x00\x12\x66\n\x1a\x65xtension_feed_item_result\x18$ \x01(\x0b\x32@.google.ads.googleads.v16.services.MutateExtensionFeedItemResultH\x00\x12S\n\x10\x66\x65\x65\x64_item_result\x18% \x01(\x0b\x32\x37.google.ads.googleads.v16.services.MutateFeedItemResultH\x00\x12Z\n\x14\x66\x65\x65\x64_item_set_result\x18\x35 \x01(\x0b\x32:.google.ads.googleads.v16.services.MutateFeedItemSetResultH\x00\x12\x63\n\x19\x66\x65\x65\x64_item_set_link_result\x18\x36 \x01(\x0b\x32>.google.ads.googleads.v16.services.MutateFeedItemSetLinkResultH\x00\x12`\n\x17\x66\x65\x65\x64_item_target_result\x18& \x01(\x0b\x32=.google.ads.googleads.v16.services.MutateFeedItemTargetResultH\x00\x12Y\n\x13\x66\x65\x65\x64_mapping_result\x18\' \x01(\x0b\x32:.google.ads.googleads.v16.services.MutateFeedMappingResultH\x00\x12J\n\x0b\x66\x65\x65\x64_result\x18( \x01(\x0b\x32\x33.google.ads.googleads.v16.services.MutateFeedResultH\x00\x12i\n\x1ckeyword_plan_ad_group_result\x18, \x01(\x0b\x32\x41.google.ads.googleads.v16.services.MutateKeywordPlanAdGroupResultH\x00\x12j\n\x1ckeyword_plan_campaign_result\x18- \x01(\x0b\x32\x42.google.ads.googleads.v16.services.MutateKeywordPlanCampaignResultH\x00\x12x\n$keyword_plan_ad_group_keyword_result\x18\x32 \x01(\x0b\x32H.google.ads.googleads.v16.services.MutateKeywordPlanAdGroupKeywordResultH\x00\x12y\n$keyword_plan_campaign_keyword_result\x18\x33 \x01(\x0b\x32I.google.ads.googleads.v16.services.MutateKeywordPlanCampaignKeywordResultH\x00\x12Z\n\x13keyword_plan_result\x18\x30 \x01(\x0b\x32;.google.ads.googleads.v16.services.MutateKeywordPlansResultH\x00\x12L\n\x0clabel_result\x18) \x01(\x0b\x32\x34.google.ads.googleads.v16.services.MutateLabelResultH\x00\x12w\n\"recommendation_subscription_result\x18U \x01(\x0b\x32I.google.ads.googleads.v16.services.MutateRecommendationSubscriptionResultH\x00\x12\x65\n\x19remarketing_action_result\x18+ \x01(\x0b\x32@.google.ads.googleads.v16.services.MutateRemarketingActionResultH\x00\x12\x61\n\x17shared_criterion_result\x18\x0e \x01(\x0b\x32>.google.ads.googleads.v16.services.MutateSharedCriterionResultH\x00\x12U\n\x11shared_set_result\x18\x0f \x01(\x0b\x32\x38.google.ads.googleads.v16.services.MutateSharedSetResultH\x00\x12l\n\x1dsmart_campaign_setting_result\x18= \x01(\x0b\x32\x43.google.ads.googleads.v16.services.MutateSmartCampaignSettingResultH\x00\x12S\n\x10user_list_result\x18\x10 \x01(\x0b\x32\x37.google.ads.googleads.v16.services.MutateUserListResultH\x00\x42\n\n\x08response2\xf5\x05\n\x10GoogleAdsService\x12\xcf\x01\n\x06Search\x12\x39.google.ads.googleads.v16.services.SearchGoogleAdsRequest\x1a:.google.ads.googleads.v16.services.SearchGoogleAdsResponse\"N\xda\x41\x11\x63ustomer_id,query\x82\xd3\xe4\x93\x02\x34\"//v16/customers/{customer_id=*}/googleAds:search:\x01*\x12\xe9\x01\n\x0cSearchStream\x12?.google.ads.googleads.v16.services.SearchGoogleAdsStreamRequest\x1a@.google.ads.googleads.v16.services.SearchGoogleAdsStreamResponse\"T\xda\x41\x11\x63ustomer_id,query\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}/googleAds:searchStream:\x01*0\x01\x12\xdb\x01\n\x06Mutate\x12\x39.google.ads.googleads.v16.services.MutateGoogleAdsRequest\x1a:.google.ads.googleads.v16.services.MutateGoogleAdsResponse\"Z\xda\x41\x1d\x63ustomer_id,mutate_operations\x82\xd3\xe4\x93\x02\x34\"//v16/customers/{customer_id=*}/googleAds:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x81\x02\n%com.google.ads.googleads.v16.servicesB\x15GoogleAdsServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.AccountBudget", "google/ads/googleads/v16/resources/account_budget.proto"], + ["google.ads.googleads.v16.resources.AccountBudgetProposal", "google/ads/googleads/v16/resources/account_budget_proposal.proto"], + ["google.ads.googleads.v16.resources.AccountLink", "google/ads/googleads/v16/resources/account_link.proto"], + ["google.ads.googleads.v16.resources.AdGroup", "google/ads/googleads/v16/resources/ad_group.proto"], + ["google.ads.googleads.v16.resources.AdGroupAd", "google/ads/googleads/v16/resources/ad_group_ad.proto"], + ["google.ads.googleads.v16.resources.AdGroupAdAssetCombinationView", "google/ads/googleads/v16/resources/ad_group_ad_asset_combination_view.proto"], + ["google.ads.googleads.v16.resources.AdGroupAdAssetView", "google/ads/googleads/v16/resources/ad_group_ad_asset_view.proto"], + ["google.ads.googleads.v16.resources.AdGroupAdLabel", "google/ads/googleads/v16/resources/ad_group_ad_label.proto"], + ["google.ads.googleads.v16.resources.AdGroupAsset", "google/ads/googleads/v16/resources/ad_group_asset.proto"], + ["google.ads.googleads.v16.resources.AdGroupAssetSet", "google/ads/googleads/v16/resources/ad_group_asset_set.proto"], + ["google.ads.googleads.v16.resources.AdGroupAudienceView", "google/ads/googleads/v16/resources/ad_group_audience_view.proto"], + ["google.ads.googleads.v16.resources.AdGroupBidModifier", "google/ads/googleads/v16/resources/ad_group_bid_modifier.proto"], + ["google.ads.googleads.v16.resources.AdGroupCriterion", "google/ads/googleads/v16/resources/ad_group_criterion.proto"], + ["google.ads.googleads.v16.resources.AdGroupCriterionCustomizer", "google/ads/googleads/v16/resources/ad_group_criterion_customizer.proto"], + ["google.ads.googleads.v16.resources.AdGroupCriterionLabel", "google/ads/googleads/v16/resources/ad_group_criterion_label.proto"], + ["google.ads.googleads.v16.resources.AdGroupCriterionSimulation", "google/ads/googleads/v16/resources/ad_group_criterion_simulation.proto"], + ["google.ads.googleads.v16.resources.AdGroupCustomizer", "google/ads/googleads/v16/resources/ad_group_customizer.proto"], + ["google.ads.googleads.v16.resources.AdGroupExtensionSetting", "google/ads/googleads/v16/resources/ad_group_extension_setting.proto"], + ["google.ads.googleads.v16.resources.AdGroupFeed", "google/ads/googleads/v16/resources/ad_group_feed.proto"], + ["google.ads.googleads.v16.resources.AdGroupLabel", "google/ads/googleads/v16/resources/ad_group_label.proto"], + ["google.ads.googleads.v16.resources.AdGroupSimulation", "google/ads/googleads/v16/resources/ad_group_simulation.proto"], + ["google.ads.googleads.v16.resources.AdParameter", "google/ads/googleads/v16/resources/ad_parameter.proto"], + ["google.ads.googleads.v16.resources.AgeRangeView", "google/ads/googleads/v16/resources/age_range_view.proto"], + ["google.ads.googleads.v16.resources.AdScheduleView", "google/ads/googleads/v16/resources/ad_schedule_view.proto"], + ["google.ads.googleads.v16.resources.DomainCategory", "google/ads/googleads/v16/resources/domain_category.proto"], + ["google.ads.googleads.v16.resources.Asset", "google/ads/googleads/v16/resources/asset.proto"], + ["google.ads.googleads.v16.resources.AssetFieldTypeView", "google/ads/googleads/v16/resources/asset_field_type_view.proto"], + ["google.ads.googleads.v16.resources.AssetGroupAsset", "google/ads/googleads/v16/resources/asset_group_asset.proto"], + ["google.ads.googleads.v16.resources.AssetGroupSignal", "google/ads/googleads/v16/resources/asset_group_signal.proto"], + ["google.ads.googleads.v16.resources.AssetGroupListingGroupFilter", "google/ads/googleads/v16/resources/asset_group_listing_group_filter.proto"], + ["google.ads.googleads.v16.resources.AssetGroupProductGroupView", "google/ads/googleads/v16/resources/asset_group_product_group_view.proto"], + ["google.ads.googleads.v16.resources.AssetGroupTopCombinationView", "google/ads/googleads/v16/resources/asset_group_top_combination_view.proto"], + ["google.ads.googleads.v16.resources.AssetGroup", "google/ads/googleads/v16/resources/asset_group.proto"], + ["google.ads.googleads.v16.resources.AssetSetAsset", "google/ads/googleads/v16/resources/asset_set_asset.proto"], + ["google.ads.googleads.v16.resources.AssetSet", "google/ads/googleads/v16/resources/asset_set.proto"], + ["google.ads.googleads.v16.resources.AssetSetTypeView", "google/ads/googleads/v16/resources/asset_set_type_view.proto"], + ["google.ads.googleads.v16.resources.BatchJob", "google/ads/googleads/v16/resources/batch_job.proto"], + ["google.ads.googleads.v16.resources.BiddingDataExclusion", "google/ads/googleads/v16/resources/bidding_data_exclusion.proto"], + ["google.ads.googleads.v16.resources.BiddingSeasonalityAdjustment", "google/ads/googleads/v16/resources/bidding_seasonality_adjustment.proto"], + ["google.ads.googleads.v16.resources.BiddingStrategy", "google/ads/googleads/v16/resources/bidding_strategy.proto"], + ["google.ads.googleads.v16.resources.BiddingStrategySimulation", "google/ads/googleads/v16/resources/bidding_strategy_simulation.proto"], + ["google.ads.googleads.v16.resources.BillingSetup", "google/ads/googleads/v16/resources/billing_setup.proto"], + ["google.ads.googleads.v16.resources.CallView", "google/ads/googleads/v16/resources/call_view.proto"], + ["google.ads.googleads.v16.resources.CampaignBudget", "google/ads/googleads/v16/resources/campaign_budget.proto"], + ["google.ads.googleads.v16.resources.Campaign", "google/ads/googleads/v16/resources/campaign.proto"], + ["google.ads.googleads.v16.resources.CampaignAsset", "google/ads/googleads/v16/resources/campaign_asset.proto"], + ["google.ads.googleads.v16.resources.CampaignAssetSet", "google/ads/googleads/v16/resources/campaign_asset_set.proto"], + ["google.ads.googleads.v16.resources.CampaignAudienceView", "google/ads/googleads/v16/resources/campaign_audience_view.proto"], + ["google.ads.googleads.v16.resources.CampaignBidModifier", "google/ads/googleads/v16/resources/campaign_bid_modifier.proto"], + ["google.ads.googleads.v16.resources.CampaignConversionGoal", "google/ads/googleads/v16/resources/campaign_conversion_goal.proto"], + ["google.ads.googleads.v16.resources.CampaignCriterion", "google/ads/googleads/v16/resources/campaign_criterion.proto"], + ["google.ads.googleads.v16.resources.CampaignCustomizer", "google/ads/googleads/v16/resources/campaign_customizer.proto"], + ["google.ads.googleads.v16.resources.CampaignDraft", "google/ads/googleads/v16/resources/campaign_draft.proto"], + ["google.ads.googleads.v16.resources.CampaignExtensionSetting", "google/ads/googleads/v16/resources/campaign_extension_setting.proto"], + ["google.ads.googleads.v16.resources.CampaignFeed", "google/ads/googleads/v16/resources/campaign_feed.proto"], + ["google.ads.googleads.v16.resources.CampaignGroup", "google/ads/googleads/v16/resources/campaign_group.proto"], + ["google.ads.googleads.v16.resources.CampaignLabel", "google/ads/googleads/v16/resources/campaign_label.proto"], + ["google.ads.googleads.v16.resources.CampaignLifecycleGoal", "google/ads/googleads/v16/resources/campaign_lifecycle_goal.proto"], + ["google.ads.googleads.v16.resources.CampaignSearchTermInsight", "google/ads/googleads/v16/resources/campaign_search_term_insight.proto"], + ["google.ads.googleads.v16.resources.CampaignSharedSet", "google/ads/googleads/v16/resources/campaign_shared_set.proto"], + ["google.ads.googleads.v16.resources.CampaignSimulation", "google/ads/googleads/v16/resources/campaign_simulation.proto"], + ["google.ads.googleads.v16.resources.CarrierConstant", "google/ads/googleads/v16/resources/carrier_constant.proto"], + ["google.ads.googleads.v16.resources.ChangeEvent", "google/ads/googleads/v16/resources/change_event.proto"], + ["google.ads.googleads.v16.resources.ChangeStatus", "google/ads/googleads/v16/resources/change_status.proto"], + ["google.ads.googleads.v16.resources.CombinedAudience", "google/ads/googleads/v16/resources/combined_audience.proto"], + ["google.ads.googleads.v16.resources.Audience", "google/ads/googleads/v16/resources/audience.proto"], + ["google.ads.googleads.v16.resources.ConversionAction", "google/ads/googleads/v16/resources/conversion_action.proto"], + ["google.ads.googleads.v16.resources.ConversionCustomVariable", "google/ads/googleads/v16/resources/conversion_custom_variable.proto"], + ["google.ads.googleads.v16.resources.ConversionGoalCampaignConfig", "google/ads/googleads/v16/resources/conversion_goal_campaign_config.proto"], + ["google.ads.googleads.v16.resources.ConversionValueRule", "google/ads/googleads/v16/resources/conversion_value_rule.proto"], + ["google.ads.googleads.v16.resources.ConversionValueRuleSet", "google/ads/googleads/v16/resources/conversion_value_rule_set.proto"], + ["google.ads.googleads.v16.resources.ClickView", "google/ads/googleads/v16/resources/click_view.proto"], + ["google.ads.googleads.v16.resources.CurrencyConstant", "google/ads/googleads/v16/resources/currency_constant.proto"], + ["google.ads.googleads.v16.resources.CustomAudience", "google/ads/googleads/v16/resources/custom_audience.proto"], + ["google.ads.googleads.v16.resources.CustomConversionGoal", "google/ads/googleads/v16/resources/custom_conversion_goal.proto"], + ["google.ads.googleads.v16.resources.CustomInterest", "google/ads/googleads/v16/resources/custom_interest.proto"], + ["google.ads.googleads.v16.resources.Customer", "google/ads/googleads/v16/resources/customer.proto"], + ["google.ads.googleads.v16.resources.CustomerAsset", "google/ads/googleads/v16/resources/customer_asset.proto"], + ["google.ads.googleads.v16.resources.CustomerAssetSet", "google/ads/googleads/v16/resources/customer_asset_set.proto"], + ["google.ads.googleads.v16.resources.AccessibleBiddingStrategy", "google/ads/googleads/v16/resources/accessible_bidding_strategy.proto"], + ["google.ads.googleads.v16.resources.CustomerCustomizer", "google/ads/googleads/v16/resources/customer_customizer.proto"], + ["google.ads.googleads.v16.resources.CustomerManagerLink", "google/ads/googleads/v16/resources/customer_manager_link.proto"], + ["google.ads.googleads.v16.resources.CustomerClientLink", "google/ads/googleads/v16/resources/customer_client_link.proto"], + ["google.ads.googleads.v16.resources.CustomerClient", "google/ads/googleads/v16/resources/customer_client.proto"], + ["google.ads.googleads.v16.resources.CustomerConversionGoal", "google/ads/googleads/v16/resources/customer_conversion_goal.proto"], + ["google.ads.googleads.v16.resources.CustomerExtensionSetting", "google/ads/googleads/v16/resources/customer_extension_setting.proto"], + ["google.ads.googleads.v16.resources.CustomerFeed", "google/ads/googleads/v16/resources/customer_feed.proto"], + ["google.ads.googleads.v16.resources.CustomerLabel", "google/ads/googleads/v16/resources/customer_label.proto"], + ["google.ads.googleads.v16.resources.CustomerLifecycleGoal", "google/ads/googleads/v16/resources/customer_lifecycle_goal.proto"], + ["google.ads.googleads.v16.resources.CustomerNegativeCriterion", "google/ads/googleads/v16/resources/customer_negative_criterion.proto"], + ["google.ads.googleads.v16.resources.CustomerSearchTermInsight", "google/ads/googleads/v16/resources/customer_search_term_insight.proto"], + ["google.ads.googleads.v16.resources.CustomerUserAccess", "google/ads/googleads/v16/resources/customer_user_access.proto"], + ["google.ads.googleads.v16.resources.CustomerUserAccessInvitation", "google/ads/googleads/v16/resources/customer_user_access_invitation.proto"], + ["google.ads.googleads.v16.resources.CustomizerAttribute", "google/ads/googleads/v16/resources/customizer_attribute.proto"], + ["google.ads.googleads.v16.resources.DetailPlacementView", "google/ads/googleads/v16/resources/detail_placement_view.proto"], + ["google.ads.googleads.v16.resources.DetailedDemographic", "google/ads/googleads/v16/resources/detailed_demographic.proto"], + ["google.ads.googleads.v16.resources.DisplayKeywordView", "google/ads/googleads/v16/resources/display_keyword_view.proto"], + ["google.ads.googleads.v16.resources.DistanceView", "google/ads/googleads/v16/resources/distance_view.proto"], + ["google.ads.googleads.v16.resources.DynamicSearchAdsSearchTermView", "google/ads/googleads/v16/resources/dynamic_search_ads_search_term_view.proto"], + ["google.ads.googleads.v16.resources.ExpandedLandingPageView", "google/ads/googleads/v16/resources/expanded_landing_page_view.proto"], + ["google.ads.googleads.v16.resources.ExtensionFeedItem", "google/ads/googleads/v16/resources/extension_feed_item.proto"], + ["google.ads.googleads.v16.resources.Feed", "google/ads/googleads/v16/resources/feed.proto"], + ["google.ads.googleads.v16.resources.FeedItem", "google/ads/googleads/v16/resources/feed_item.proto"], + ["google.ads.googleads.v16.resources.FeedItemSet", "google/ads/googleads/v16/resources/feed_item_set.proto"], + ["google.ads.googleads.v16.resources.FeedItemSetLink", "google/ads/googleads/v16/resources/feed_item_set_link.proto"], + ["google.ads.googleads.v16.resources.FeedItemTarget", "google/ads/googleads/v16/resources/feed_item_target.proto"], + ["google.ads.googleads.v16.resources.FeedMapping", "google/ads/googleads/v16/resources/feed_mapping.proto"], + ["google.ads.googleads.v16.resources.FeedPlaceholderView", "google/ads/googleads/v16/resources/feed_placeholder_view.proto"], + ["google.ads.googleads.v16.resources.GenderView", "google/ads/googleads/v16/resources/gender_view.proto"], + ["google.ads.googleads.v16.resources.GeoTargetConstant", "google/ads/googleads/v16/resources/geo_target_constant.proto"], + ["google.ads.googleads.v16.resources.GeographicView", "google/ads/googleads/v16/resources/geographic_view.proto"], + ["google.ads.googleads.v16.resources.GroupPlacementView", "google/ads/googleads/v16/resources/group_placement_view.proto"], + ["google.ads.googleads.v16.resources.HotelGroupView", "google/ads/googleads/v16/resources/hotel_group_view.proto"], + ["google.ads.googleads.v16.resources.HotelPerformanceView", "google/ads/googleads/v16/resources/hotel_performance_view.proto"], + ["google.ads.googleads.v16.resources.HotelReconciliation", "google/ads/googleads/v16/resources/hotel_reconciliation.proto"], + ["google.ads.googleads.v16.resources.IncomeRangeView", "google/ads/googleads/v16/resources/income_range_view.proto"], + ["google.ads.googleads.v16.resources.KeywordView", "google/ads/googleads/v16/resources/keyword_view.proto"], + ["google.ads.googleads.v16.resources.KeywordPlan", "google/ads/googleads/v16/resources/keyword_plan.proto"], + ["google.ads.googleads.v16.resources.KeywordPlanCampaign", "google/ads/googleads/v16/resources/keyword_plan_campaign.proto"], + ["google.ads.googleads.v16.resources.KeywordPlanCampaignKeyword", "google/ads/googleads/v16/resources/keyword_plan_campaign_keyword.proto"], + ["google.ads.googleads.v16.resources.KeywordPlanAdGroup", "google/ads/googleads/v16/resources/keyword_plan_ad_group.proto"], + ["google.ads.googleads.v16.resources.KeywordPlanAdGroupKeyword", "google/ads/googleads/v16/resources/keyword_plan_ad_group_keyword.proto"], + ["google.ads.googleads.v16.resources.KeywordThemeConstant", "google/ads/googleads/v16/resources/keyword_theme_constant.proto"], + ["google.ads.googleads.v16.resources.Label", "google/ads/googleads/v16/resources/label.proto"], + ["google.ads.googleads.v16.resources.LandingPageView", "google/ads/googleads/v16/resources/landing_page_view.proto"], + ["google.ads.googleads.v16.resources.LanguageConstant", "google/ads/googleads/v16/resources/language_constant.proto"], + ["google.ads.googleads.v16.resources.LocationView", "google/ads/googleads/v16/resources/location_view.proto"], + ["google.ads.googleads.v16.resources.ManagedPlacementView", "google/ads/googleads/v16/resources/managed_placement_view.proto"], + ["google.ads.googleads.v16.resources.MediaFile", "google/ads/googleads/v16/resources/media_file.proto"], + ["google.ads.googleads.v16.resources.LocalServicesEmployee", "google/ads/googleads/v16/resources/local_services_employee.proto"], + ["google.ads.googleads.v16.resources.LocalServicesVerificationArtifact", "google/ads/googleads/v16/resources/local_services_verification_artifact.proto"], + ["google.ads.googleads.v16.resources.MobileAppCategoryConstant", "google/ads/googleads/v16/resources/mobile_app_category_constant.proto"], + ["google.ads.googleads.v16.resources.MobileDeviceConstant", "google/ads/googleads/v16/resources/mobile_device_constant.proto"], + ["google.ads.googleads.v16.resources.OfflineConversionUploadClientSummary", "google/ads/googleads/v16/resources/offline_conversion_upload_client_summary.proto"], + ["google.ads.googleads.v16.resources.OfflineUserDataJob", "google/ads/googleads/v16/resources/offline_user_data_job.proto"], + ["google.ads.googleads.v16.resources.OperatingSystemVersionConstant", "google/ads/googleads/v16/resources/operating_system_version_constant.proto"], + ["google.ads.googleads.v16.resources.PaidOrganicSearchTermView", "google/ads/googleads/v16/resources/paid_organic_search_term_view.proto"], + ["google.ads.googleads.v16.resources.QualifyingQuestion", "google/ads/googleads/v16/resources/qualifying_question.proto"], + ["google.ads.googleads.v16.resources.ParentalStatusView", "google/ads/googleads/v16/resources/parental_status_view.proto"], + ["google.ads.googleads.v16.resources.PerStoreView", "google/ads/googleads/v16/resources/per_store_view.proto"], + ["google.ads.googleads.v16.resources.ProductCategoryConstant", "google/ads/googleads/v16/resources/product_category_constant.proto"], + ["google.ads.googleads.v16.resources.ProductGroupView", "google/ads/googleads/v16/resources/product_group_view.proto"], + ["google.ads.googleads.v16.resources.ProductLink", "google/ads/googleads/v16/resources/product_link.proto"], + ["google.ads.googleads.v16.resources.ProductLinkInvitation", "google/ads/googleads/v16/resources/product_link_invitation.proto"], + ["google.ads.googleads.v16.resources.Recommendation", "google/ads/googleads/v16/resources/recommendation.proto"], + ["google.ads.googleads.v16.resources.RecommendationSubscription", "google/ads/googleads/v16/resources/recommendation_subscription.proto"], + ["google.ads.googleads.v16.resources.SearchTermView", "google/ads/googleads/v16/resources/search_term_view.proto"], + ["google.ads.googleads.v16.resources.SharedCriterion", "google/ads/googleads/v16/resources/shared_criterion.proto"], + ["google.ads.googleads.v16.resources.SharedSet", "google/ads/googleads/v16/resources/shared_set.proto"], + ["google.ads.googleads.v16.resources.SmartCampaignSetting", "google/ads/googleads/v16/resources/smart_campaign_setting.proto"], + ["google.ads.googleads.v16.resources.ShoppingPerformanceView", "google/ads/googleads/v16/resources/shopping_performance_view.proto"], + ["google.ads.googleads.v16.resources.SmartCampaignSearchTermView", "google/ads/googleads/v16/resources/smart_campaign_search_term_view.proto"], + ["google.ads.googleads.v16.resources.ThirdPartyAppAnalyticsLink", "google/ads/googleads/v16/resources/third_party_app_analytics_link.proto"], + ["google.ads.googleads.v16.resources.TopicView", "google/ads/googleads/v16/resources/topic_view.proto"], + ["google.ads.googleads.v16.resources.TravelActivityGroupView", "google/ads/googleads/v16/resources/travel_activity_group_view.proto"], + ["google.ads.googleads.v16.resources.TravelActivityPerformanceView", "google/ads/googleads/v16/resources/travel_activity_performance_view.proto"], + ["google.ads.googleads.v16.resources.Experiment", "google/ads/googleads/v16/resources/experiment.proto"], + ["google.ads.googleads.v16.resources.ExperimentArm", "google/ads/googleads/v16/resources/experiment_arm.proto"], + ["google.ads.googleads.v16.resources.UserInterest", "google/ads/googleads/v16/resources/user_interest.proto"], + ["google.ads.googleads.v16.resources.LifeEvent", "google/ads/googleads/v16/resources/life_event.proto"], + ["google.ads.googleads.v16.resources.UserList", "google/ads/googleads/v16/resources/user_list.proto"], + ["google.ads.googleads.v16.resources.UserLocationView", "google/ads/googleads/v16/resources/user_location_view.proto"], + ["google.ads.googleads.v16.resources.RemarketingAction", "google/ads/googleads/v16/resources/remarketing_action.proto"], + ["google.ads.googleads.v16.resources.TopicConstant", "google/ads/googleads/v16/resources/topic_constant.proto"], + ["google.ads.googleads.v16.resources.Video", "google/ads/googleads/v16/resources/video.proto"], + ["google.ads.googleads.v16.resources.WebpageView", "google/ads/googleads/v16/resources/webpage_view.proto"], + ["google.ads.googleads.v16.resources.LeadFormSubmissionData", "google/ads/googleads/v16/resources/lead_form_submission_data.proto"], + ["google.ads.googleads.v16.resources.LocalServicesLead", "google/ads/googleads/v16/resources/local_services_lead.proto"], + ["google.ads.googleads.v16.resources.LocalServicesLeadConversation", "google/ads/googleads/v16/resources/local_services_lead_conversation.proto"], + ["google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleAdGroup", "google/ads/googleads/v16/resources/android_privacy_shared_key_google_ad_group.proto"], + ["google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleCampaign", "google/ads/googleads/v16/resources/android_privacy_shared_key_google_campaign.proto"], + ["google.ads.googleads.v16.resources.AndroidPrivacySharedKeyGoogleNetworkType", "google/ads/googleads/v16/resources/android_privacy_shared_key_google_network_type.proto"], + ["google.ads.googleads.v16.common.Metrics", "google/ads/googleads/v16/common/metrics.proto"], + ["google.ads.googleads.v16.common.Segments", "google/ads/googleads/v16/common/segments.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.ads.googleads.v16.services.AdGroupAdLabelOperation", "google/ads/googleads/v16/services/ad_group_ad_label_service.proto"], + ["google.ads.googleads.v16.services.AdGroupAdOperation", "google/ads/googleads/v16/services/ad_group_ad_service.proto"], + ["google.ads.googleads.v16.services.AdGroupAssetOperation", "google/ads/googleads/v16/services/ad_group_asset_service.proto"], + ["google.ads.googleads.v16.services.AdGroupBidModifierOperation", "google/ads/googleads/v16/services/ad_group_bid_modifier_service.proto"], + ["google.ads.googleads.v16.services.AdGroupCriterionCustomizerOperation", "google/ads/googleads/v16/services/ad_group_criterion_customizer_service.proto"], + ["google.ads.googleads.v16.services.AdGroupCriterionLabelOperation", "google/ads/googleads/v16/services/ad_group_criterion_label_service.proto"], + ["google.ads.googleads.v16.services.AdGroupCriterionOperation", "google/ads/googleads/v16/services/ad_group_criterion_service.proto"], + ["google.ads.googleads.v16.services.AdGroupCustomizerOperation", "google/ads/googleads/v16/services/ad_group_customizer_service.proto"], + ["google.ads.googleads.v16.services.AdGroupExtensionSettingOperation", "google/ads/googleads/v16/services/ad_group_extension_setting_service.proto"], + ["google.ads.googleads.v16.services.AdGroupFeedOperation", "google/ads/googleads/v16/services/ad_group_feed_service.proto"], + ["google.ads.googleads.v16.services.AdGroupLabelOperation", "google/ads/googleads/v16/services/ad_group_label_service.proto"], + ["google.ads.googleads.v16.services.AdGroupOperation", "google/ads/googleads/v16/services/ad_group_service.proto"], + ["google.ads.googleads.v16.services.AdOperation", "google/ads/googleads/v16/services/ad_service.proto"], + ["google.ads.googleads.v16.services.AdParameterOperation", "google/ads/googleads/v16/services/ad_parameter_service.proto"], + ["google.ads.googleads.v16.services.AssetOperation", "google/ads/googleads/v16/services/asset_service.proto"], + ["google.ads.googleads.v16.services.AssetGroupAssetOperation", "google/ads/googleads/v16/services/asset_group_asset_service.proto"], + ["google.ads.googleads.v16.services.AssetGroupListingGroupFilterOperation", "google/ads/googleads/v16/services/asset_group_listing_group_filter_service.proto"], + ["google.ads.googleads.v16.services.AssetGroupSignalOperation", "google/ads/googleads/v16/services/asset_group_signal_service.proto"], + ["google.ads.googleads.v16.services.AssetGroupOperation", "google/ads/googleads/v16/services/asset_group_service.proto"], + ["google.ads.googleads.v16.services.AssetSetAssetOperation", "google/ads/googleads/v16/services/asset_set_asset_service.proto"], + ["google.ads.googleads.v16.services.AssetSetOperation", "google/ads/googleads/v16/services/asset_set_service.proto"], + ["google.ads.googleads.v16.services.AudienceOperation", "google/ads/googleads/v16/services/audience_service.proto"], + ["google.ads.googleads.v16.services.BiddingDataExclusionOperation", "google/ads/googleads/v16/services/bidding_data_exclusion_service.proto"], + ["google.ads.googleads.v16.services.BiddingSeasonalityAdjustmentOperation", "google/ads/googleads/v16/services/bidding_seasonality_adjustment_service.proto"], + ["google.ads.googleads.v16.services.BiddingStrategyOperation", "google/ads/googleads/v16/services/bidding_strategy_service.proto"], + ["google.ads.googleads.v16.services.CampaignAssetOperation", "google/ads/googleads/v16/services/campaign_asset_service.proto"], + ["google.ads.googleads.v16.services.CampaignAssetSetOperation", "google/ads/googleads/v16/services/campaign_asset_set_service.proto"], + ["google.ads.googleads.v16.services.CampaignBidModifierOperation", "google/ads/googleads/v16/services/campaign_bid_modifier_service.proto"], + ["google.ads.googleads.v16.services.CampaignBudgetOperation", "google/ads/googleads/v16/services/campaign_budget_service.proto"], + ["google.ads.googleads.v16.services.CampaignConversionGoalOperation", "google/ads/googleads/v16/services/campaign_conversion_goal_service.proto"], + ["google.ads.googleads.v16.services.CampaignCriterionOperation", "google/ads/googleads/v16/services/campaign_criterion_service.proto"], + ["google.ads.googleads.v16.services.CampaignCustomizerOperation", "google/ads/googleads/v16/services/campaign_customizer_service.proto"], + ["google.ads.googleads.v16.services.CampaignDraftOperation", "google/ads/googleads/v16/services/campaign_draft_service.proto"], + ["google.ads.googleads.v16.services.CampaignExtensionSettingOperation", "google/ads/googleads/v16/services/campaign_extension_setting_service.proto"], + ["google.ads.googleads.v16.services.CampaignFeedOperation", "google/ads/googleads/v16/services/campaign_feed_service.proto"], + ["google.ads.googleads.v16.services.CampaignGroupOperation", "google/ads/googleads/v16/services/campaign_group_service.proto"], + ["google.ads.googleads.v16.services.CampaignLabelOperation", "google/ads/googleads/v16/services/campaign_label_service.proto"], + ["google.ads.googleads.v16.services.CampaignOperation", "google/ads/googleads/v16/services/campaign_service.proto"], + ["google.ads.googleads.v16.services.CampaignSharedSetOperation", "google/ads/googleads/v16/services/campaign_shared_set_service.proto"], + ["google.ads.googleads.v16.services.ConversionActionOperation", "google/ads/googleads/v16/services/conversion_action_service.proto"], + ["google.ads.googleads.v16.services.ConversionCustomVariableOperation", "google/ads/googleads/v16/services/conversion_custom_variable_service.proto"], + ["google.ads.googleads.v16.services.ConversionGoalCampaignConfigOperation", "google/ads/googleads/v16/services/conversion_goal_campaign_config_service.proto"], + ["google.ads.googleads.v16.services.ConversionValueRuleOperation", "google/ads/googleads/v16/services/conversion_value_rule_service.proto"], + ["google.ads.googleads.v16.services.ConversionValueRuleSetOperation", "google/ads/googleads/v16/services/conversion_value_rule_set_service.proto"], + ["google.ads.googleads.v16.services.CustomConversionGoalOperation", "google/ads/googleads/v16/services/custom_conversion_goal_service.proto"], + ["google.ads.googleads.v16.services.CustomerAssetOperation", "google/ads/googleads/v16/services/customer_asset_service.proto"], + ["google.ads.googleads.v16.services.CustomerConversionGoalOperation", "google/ads/googleads/v16/services/customer_conversion_goal_service.proto"], + ["google.ads.googleads.v16.services.CustomerCustomizerOperation", "google/ads/googleads/v16/services/customer_customizer_service.proto"], + ["google.ads.googleads.v16.services.CustomerExtensionSettingOperation", "google/ads/googleads/v16/services/customer_extension_setting_service.proto"], + ["google.ads.googleads.v16.services.CustomerFeedOperation", "google/ads/googleads/v16/services/customer_feed_service.proto"], + ["google.ads.googleads.v16.services.CustomerLabelOperation", "google/ads/googleads/v16/services/customer_label_service.proto"], + ["google.ads.googleads.v16.services.CustomerNegativeCriterionOperation", "google/ads/googleads/v16/services/customer_negative_criterion_service.proto"], + ["google.ads.googleads.v16.services.CustomerOperation", "google/ads/googleads/v16/services/customer_service.proto"], + ["google.ads.googleads.v16.services.CustomizerAttributeOperation", "google/ads/googleads/v16/services/customizer_attribute_service.proto"], + ["google.ads.googleads.v16.services.ExperimentOperation", "google/ads/googleads/v16/services/experiment_service.proto"], + ["google.ads.googleads.v16.services.ExperimentArmOperation", "google/ads/googleads/v16/services/experiment_arm_service.proto"], + ["google.ads.googleads.v16.services.ExtensionFeedItemOperation", "google/ads/googleads/v16/services/extension_feed_item_service.proto"], + ["google.ads.googleads.v16.services.FeedItemOperation", "google/ads/googleads/v16/services/feed_item_service.proto"], + ["google.ads.googleads.v16.services.FeedItemSetOperation", "google/ads/googleads/v16/services/feed_item_set_service.proto"], + ["google.ads.googleads.v16.services.FeedItemSetLinkOperation", "google/ads/googleads/v16/services/feed_item_set_link_service.proto"], + ["google.ads.googleads.v16.services.FeedItemTargetOperation", "google/ads/googleads/v16/services/feed_item_target_service.proto"], + ["google.ads.googleads.v16.services.FeedMappingOperation", "google/ads/googleads/v16/services/feed_mapping_service.proto"], + ["google.ads.googleads.v16.services.FeedOperation", "google/ads/googleads/v16/services/feed_service.proto"], + ["google.ads.googleads.v16.services.KeywordPlanAdGroupOperation", "google/ads/googleads/v16/services/keyword_plan_ad_group_service.proto"], + ["google.ads.googleads.v16.services.KeywordPlanAdGroupKeywordOperation", "google/ads/googleads/v16/services/keyword_plan_ad_group_keyword_service.proto"], + ["google.ads.googleads.v16.services.KeywordPlanCampaignKeywordOperation", "google/ads/googleads/v16/services/keyword_plan_campaign_keyword_service.proto"], + ["google.ads.googleads.v16.services.KeywordPlanCampaignOperation", "google/ads/googleads/v16/services/keyword_plan_campaign_service.proto"], + ["google.ads.googleads.v16.services.KeywordPlanOperation", "google/ads/googleads/v16/services/keyword_plan_service.proto"], + ["google.ads.googleads.v16.services.LabelOperation", "google/ads/googleads/v16/services/label_service.proto"], + ["google.ads.googleads.v16.services.RecommendationSubscriptionOperation", "google/ads/googleads/v16/services/recommendation_subscription_service.proto"], + ["google.ads.googleads.v16.services.RemarketingActionOperation", "google/ads/googleads/v16/services/remarketing_action_service.proto"], + ["google.ads.googleads.v16.services.SharedCriterionOperation", "google/ads/googleads/v16/services/shared_criterion_service.proto"], + ["google.ads.googleads.v16.services.SharedSetOperation", "google/ads/googleads/v16/services/shared_set_service.proto"], + ["google.ads.googleads.v16.services.SmartCampaignSettingOperation", "google/ads/googleads/v16/services/smart_campaign_setting_service.proto"], + ["google.ads.googleads.v16.services.UserListOperation", "google/ads/googleads/v16/services/user_list_service.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + SearchGoogleAdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SearchGoogleAdsRequest").msgclass + SearchGoogleAdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SearchGoogleAdsResponse").msgclass + SearchGoogleAdsStreamRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SearchGoogleAdsStreamRequest").msgclass + SearchGoogleAdsStreamResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SearchGoogleAdsStreamResponse").msgclass + GoogleAdsRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GoogleAdsRow").msgclass + MutateGoogleAdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateGoogleAdsRequest").msgclass + MutateGoogleAdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateGoogleAdsResponse").msgclass + MutateOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateOperation").msgclass + MutateOperationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateOperationResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/google_ads_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/google_ads_service_services_pb.rb new file mode 100644 index 000000000..aecda4142 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/google_ads_service_services_pb.rb @@ -0,0 +1,188 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/google_ads_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/google_ads_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module GoogleAdsService + # Proto file describing the GoogleAdsService. + # + # Service to fetch data and metrics across resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.GoogleAdsService' + + # Returns all rows that match the search query. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ChangeEventError]() + # [ChangeStatusError]() + # [ClickViewError]() + # [HeaderError]() + # [InternalError]() + # [QueryError]() + # [QuotaError]() + # [RequestError]() + rpc :Search, ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsRequest, ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsResponse + # Returns all rows that match the search stream query. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ChangeEventError]() + # [ChangeStatusError]() + # [ClickViewError]() + # [HeaderError]() + # [InternalError]() + # [QueryError]() + # [QuotaError]() + # [RequestError]() + rpc :SearchStream, ::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamRequest, stream(::Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamResponse) + # Creates, updates, or removes resources. This method supports atomic + # transactions with multiple types of resources. For example, you can + # atomically create a campaign and a campaign budget, or perform up to + # thousands of mutates atomically. + # + # This method is essentially a wrapper around a series of mutate methods. The + # only features it offers over calling those methods directly are: + # + # - Atomic transactions + # - Temp resource names (described below) + # - Somewhat reduced latency over making a series of mutate calls + # + # Note: Only resources that support atomic transactions are included, so this + # method can't replace all calls to individual services. + # + # ## Atomic Transaction Benefits + # + # Atomicity makes error handling much easier. If you're making a series of + # changes and one fails, it can leave your account in an inconsistent state. + # With atomicity, you either reach the chosen state directly, or the request + # fails and you can retry. + # + # ## Temp Resource Names + # + # Temp resource names are a special type of resource name used to create a + # resource and reference that resource in the same request. For example, if a + # campaign budget is created with `resource_name` equal to + # `customers/123/campaignBudgets/-1`, that resource name can be reused in + # the `Campaign.budget` field in the same request. That way, the two + # resources are created and linked atomically. + # + # To create a temp resource name, put a negative number in the part of the + # name that the server would normally allocate. + # + # Note: + # + # - Resources must be created with a temp name before the name can be reused. + # For example, the previous CampaignBudget+Campaign example would fail if + # the mutate order was reversed. + # - Temp names are not remembered across requests. + # - There's no limit to the number of temp names in a request. + # - Each temp name must use a unique negative number, even if the resource + # types differ. + # + # ## Latency + # + # It's important to group mutates by resource type or the request may time + # out and fail. Latency is roughly equal to a series of calls to individual + # mutate methods, where each change in resource type is a new call. For + # example, mutating 10 campaigns then 10 ad groups is like 2 calls, while + # mutating 1 campaign, 1 ad group, 1 campaign, 1 ad group is like 4 calls. + # + # List of thrown errors: + # [AdCustomizerError]() + # [AdError]() + # [AdGroupAdError]() + # [AdGroupCriterionError]() + # [AdGroupError]() + # [AssetError]() + # [AuthenticationError]() + # [AuthorizationError]() + # [BiddingError]() + # [CampaignBudgetError]() + # [CampaignCriterionError]() + # [CampaignError]() + # [CampaignExperimentError]() + # [CampaignSharedSetError]() + # [CollectionSizeError]() + # [ContextError]() + # [ConversionActionError]() + # [CriterionError]() + # [CustomerFeedError]() + # [DatabaseError]() + # [DateError]() + # [DateRangeError]() + # [DistinctError]() + # [ExtensionFeedItemError]() + # [ExtensionSettingError]() + # [FeedAttributeReferenceError]() + # [FeedError]() + # [FeedItemError]() + # [FeedItemSetError]() + # [FieldError]() + # [FieldMaskError]() + # [FunctionParsingError]() + # [HeaderError]() + # [ImageError]() + # [InternalError]() + # [KeywordPlanAdGroupKeywordError]() + # [KeywordPlanCampaignError]() + # [KeywordPlanError]() + # [LabelError]() + # [ListOperationError]() + # [MediaUploadError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NullError]() + # [OperationAccessDeniedError]() + # [PolicyFindingError]() + # [PolicyViolationError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SettingError]() + # [SharedSetError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # [UrlFieldError]() + # [UserListError]() + # [YoutubeVideoRegistrationError]() + rpc :Mutate, ::Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateGoogleAdsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/identity_verification_service.rb b/lib/google/ads/google_ads/v16/services/identity_verification_service.rb new file mode 100644 index 000000000..d2a58e2d7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/identity_verification_service.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/identity_verification_service/credentials" +require "google/ads/google_ads/v16/services/identity_verification_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # A service for managing Identity Verification Service. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/identity_verification_service" + # client = ::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client.new + # + module IdentityVerificationService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "identity_verification_service", "helpers.rb" +require "google/ads/google_ads/v16/services/identity_verification_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/identity_verification_service/client.rb b/lib/google/ads/google_ads/v16/services/identity_verification_service/client.rb new file mode 100644 index 000000000..0240c116c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/identity_verification_service/client.rb @@ -0,0 +1,538 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/identity_verification_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module IdentityVerificationService + ## + # Client for the IdentityVerificationService service. + # + # A service for managing Identity Verification Service. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :identity_verification_service_stub + + ## + # Configure the IdentityVerificationService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IdentityVerificationService clients + # ::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IdentityVerificationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @identity_verification_service_stub.universe_domain + end + + ## + # Create a new IdentityVerificationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IdentityVerificationService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/identity_verification_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @identity_verification_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Starts Identity Verification for a given verification program type. + # Statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload start_identity_verification(request, options = nil) + # Pass arguments to `start_identity_verification` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::StartIdentityVerificationRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::StartIdentityVerificationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_identity_verification(customer_id: nil, verification_program: nil) + # Pass arguments to `start_identity_verification` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The Id of the customer for whom we are creating this + # verification. + # @param verification_program [::Google::Ads::GoogleAds::V16::Enums::IdentityVerificationProgramEnum::IdentityVerificationProgram] + # Required. The verification program type for which we want to start the + # verification. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::StartIdentityVerificationRequest.new + # + # # Call the start_identity_verification method. + # result = client.start_identity_verification request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def start_identity_verification request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::StartIdentityVerificationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.start_identity_verification.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.start_identity_verification.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_identity_verification.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_verification_service_stub.call_rpc :start_identity_verification, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns Identity Verification information. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload get_identity_verification(request, options = nil) + # Pass arguments to `get_identity_verification` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_identity_verification(customer_id: nil) + # Pass arguments to `get_identity_verification` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer for whom we are requesting verification + # information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationRequest.new + # + # # Call the get_identity_verification method. + # result = client.get_identity_verification request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationResponse. + # p result + # + def get_identity_verification request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_identity_verification.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_identity_verification.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_identity_verification.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_verification_service_stub.call_rpc :get_identity_verification, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the IdentityVerificationService API. + # + # This class represents the configuration for IdentityVerificationService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # start_identity_verification to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.start_identity_verification.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.start_identity_verification.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the IdentityVerificationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `start_identity_verification` + # @return [::Gapic::Config::Method] + # + attr_reader :start_identity_verification + ## + # RPC-specific configuration for `get_identity_verification` + # @return [::Gapic::Config::Method] + # + attr_reader :get_identity_verification + + # @private + def initialize parent_rpcs = nil + start_identity_verification_config = parent_rpcs.start_identity_verification if parent_rpcs.respond_to? :start_identity_verification + @start_identity_verification = ::Gapic::Config::Method.new start_identity_verification_config + get_identity_verification_config = parent_rpcs.get_identity_verification if parent_rpcs.respond_to? :get_identity_verification + @get_identity_verification = ::Gapic::Config::Method.new get_identity_verification_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/identity_verification_service/credentials.rb b/lib/google/ads/google_ads/v16/services/identity_verification_service/credentials.rb new file mode 100644 index 000000000..03d4692a7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/identity_verification_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module IdentityVerificationService + # Credentials for the IdentityVerificationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/identity_verification_service_pb.rb b/lib/google/ads/google_ads/v16/services/identity_verification_service_pb.rb new file mode 100644 index 000000000..9adee9150 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/identity_verification_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/identity_verification_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/identity_verification_program_pb' +require 'google/ads/google_ads/v16/enums/identity_verification_program_status_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/services/identity_verification_service.proto\x12!google.ads.googleads.v16.services\x1a\x42google/ads/googleads/v16/enums/identity_verification_program.proto\x1aIgoogle/ads/googleads/v16/enums/identity_verification_program_status.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xbc\x01\n StartIdentityVerificationRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12~\n\x14verification_program\x18\x02 \x01(\x0e\x32[.google.ads.googleads.v16.enums.IdentityVerificationProgramEnum.IdentityVerificationProgramB\x03\xe0\x41\x02\":\n\x1eGetIdentityVerificationRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"y\n\x1fGetIdentityVerificationResponse\x12V\n\x15identity_verification\x18\x01 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.IdentityVerification\"\xaa\x03\n\x14IdentityVerification\x12y\n\x14verification_program\x18\x01 \x01(\x0e\x32[.google.ads.googleads.v16.enums.IdentityVerificationProgramEnum.IdentityVerificationProgram\x12r\n!identity_verification_requirement\x18\x02 \x01(\x0b\x32\x42.google.ads.googleads.v16.services.IdentityVerificationRequirementH\x00\x88\x01\x01\x12\x63\n\x15verification_progress\x18\x03 \x01(\x0b\x32?.google.ads.googleads.v16.services.IdentityVerificationProgressH\x01\x88\x01\x01\x42$\n\"_identity_verification_requirementB\x18\n\x16_verification_progress\"\xdc\x01\n\x1cIdentityVerificationProgress\x12\x7f\n\x0eprogram_status\x18\x01 \x01(\x0e\x32g.google.ads.googleads.v16.enums.IdentityVerificationProgramStatusEnum.IdentityVerificationProgramStatus\x12\'\n\x1finvitation_link_expiration_time\x18\x02 \x01(\t\x12\x12\n\naction_url\x18\x03 \x01(\t\"z\n\x1fIdentityVerificationRequirement\x12(\n verification_start_deadline_time\x18\x01 \x01(\t\x12-\n%verification_completion_deadline_time\x18\x02 \x01(\t2\xb8\x04\n\x1bIdentityVerificationService\x12\xe0\x01\n\x19StartIdentityVerification\x12\x43.google.ads.googleads.v16.services.StartIdentityVerificationRequest\x1a\x16.google.protobuf.Empty\"f\xda\x41 customer_id,verification_program\x82\xd3\xe4\x93\x02=\"8/v16/customers/{customer_id=*}:startIdentityVerification:\x01*\x12\xee\x01\n\x17GetIdentityVerification\x12\x41.google.ads.googleads.v16.services.GetIdentityVerificationRequest\x1a\x42.google.ads.googleads.v16.services.GetIdentityVerificationResponse\"L\xda\x41\x0b\x63ustomer_id\x82\xd3\xe4\x93\x02\x38\x12\x36/v16/customers/{customer_id=*}/getIdentityVerification\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8c\x02\n%com.google.ads.googleads.v16.servicesB IdentityVerificationServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + StartIdentityVerificationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.StartIdentityVerificationRequest").msgclass + GetIdentityVerificationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GetIdentityVerificationRequest").msgclass + GetIdentityVerificationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GetIdentityVerificationResponse").msgclass + IdentityVerification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.IdentityVerification").msgclass + IdentityVerificationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.IdentityVerificationProgress").msgclass + IdentityVerificationRequirement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.IdentityVerificationRequirement").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/identity_verification_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/identity_verification_service_services_pb.rb new file mode 100644 index 000000000..83010a1a9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/identity_verification_service_services_pb.rb @@ -0,0 +1,68 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/identity_verification_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/identity_verification_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module IdentityVerificationService + # Proto file describing the IdentityVerificatio Service. + # + # A service for managing Identity Verification Service. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.IdentityVerificationService' + + # Starts Identity Verification for a given verification program type. + # Statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :StartIdentityVerification, ::Google::Ads::GoogleAds::V16::Services::StartIdentityVerificationRequest, ::Google::Protobuf::Empty + # Returns Identity Verification information. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :GetIdentityVerification, ::Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationRequest, ::Google::Ads::GoogleAds::V16::Services::GetIdentityVerificationResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/invoice_service.rb b/lib/google/ads/google_ads/v16/services/invoice_service.rb new file mode 100644 index 000000000..247b03f1e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/invoice_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/invoice_service/credentials" +require "google/ads/google_ads/v16/services/invoice_service/paths" +require "google/ads/google_ads/v16/services/invoice_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # A service to fetch invoices issued for a billing setup during a given month. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/invoice_service" + # client = ::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client.new + # + module InvoiceService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "invoice_service", "helpers.rb" +require "google/ads/google_ads/v16/services/invoice_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/invoice_service/client.rb b/lib/google/ads/google_ads/v16/services/invoice_service/client.rb new file mode 100644 index 000000000..c6dd75d13 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/invoice_service/client.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/invoice_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module InvoiceService + ## + # Client for the InvoiceService service. + # + # A service to fetch invoices issued for a billing setup during a given month. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :invoice_service_stub + + ## + # Configure the InvoiceService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all InvoiceService clients + # ::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the InvoiceService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @invoice_service_stub.universe_domain + end + + ## + # Create a new InvoiceService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the InvoiceService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/invoice_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @invoice_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::InvoiceService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns all invoices associated with a billing setup, for a given month. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [InvoiceError]() + # [QuotaError]() + # [RequestError]() + # + # @overload list_invoices(request, options = nil) + # Pass arguments to `list_invoices` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListInvoicesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListInvoicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_invoices(customer_id: nil, billing_setup: nil, issue_year: nil, issue_month: nil) + # Pass arguments to `list_invoices` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer to fetch invoices for. + # @param billing_setup [::String] + # Required. The billing setup resource name of the requested invoices. + # + # `customers/{customer_id}/billingSetups/{billing_setup_id}` + # @param issue_year [::String] + # Required. The issue year to retrieve invoices, in yyyy format. Only + # invoices issued in 2019 or later can be retrieved. + # @param issue_month [::Google::Ads::GoogleAds::V16::Enums::MonthOfYearEnum::MonthOfYear] + # Required. The issue month to retrieve invoices. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ListInvoicesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ListInvoicesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::InvoiceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListInvoicesRequest.new + # + # # Call the list_invoices method. + # result = client.list_invoices request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ListInvoicesResponse. + # p result + # + def list_invoices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListInvoicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_invoices.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_invoices.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_invoices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @invoice_service_stub.call_rpc :list_invoices, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the InvoiceService API. + # + # This class represents the configuration for InvoiceService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_invoices to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_invoices.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::InvoiceService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_invoices.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the InvoiceService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_invoices` + # @return [::Gapic::Config::Method] + # + attr_reader :list_invoices + + # @private + def initialize parent_rpcs = nil + list_invoices_config = parent_rpcs.list_invoices if parent_rpcs.respond_to? :list_invoices + @list_invoices = ::Gapic::Config::Method.new list_invoices_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/invoice_service/credentials.rb b/lib/google/ads/google_ads/v16/services/invoice_service/credentials.rb new file mode 100644 index 000000000..74ba7f68b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/invoice_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module InvoiceService + # Credentials for the InvoiceService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/invoice_service/paths.rb b/lib/google/ads/google_ads/v16/services/invoice_service/paths.rb new file mode 100644 index 000000000..3e5359e5c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/invoice_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module InvoiceService + # Path helper methods for the InvoiceService API. + module Paths + ## + # Create a fully-qualified Invoice resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/invoices/{invoice_id}` + # + # @param customer_id [String] + # @param invoice_id [String] + # + # @return [::String] + def invoice_path customer_id:, invoice_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/invoices/#{invoice_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/invoice_service_pb.rb b/lib/google/ads/google_ads/v16/services/invoice_service_pb.rb new file mode 100644 index 000000000..d4375a8a7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/invoice_service_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/invoice_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/month_of_year_pb' +require 'google/ads/google_ads/v16/resources/invoice_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n7google/ads/googleads/v16/services/invoice_service.proto\x12!google.ads.googleads.v16.services\x1a\x32google/ads/googleads/v16/enums/month_of_year.proto\x1a\x30google/ads/googleads/v16/resources/invoice.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"\xbb\x01\n\x13ListInvoicesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rbilling_setup\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nissue_year\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12U\n\x0bissue_month\x18\x04 \x01(\x0e\x32;.google.ads.googleads.v16.enums.MonthOfYearEnum.MonthOfYearB\x03\xe0\x41\x02\"U\n\x14ListInvoicesResponse\x12=\n\x08invoices\x18\x01 \x03(\x0b\x32+.google.ads.googleads.v16.resources.Invoice2\xbd\x02\n\x0eInvoiceService\x12\xe3\x01\n\x0cListInvoices\x12\x36.google.ads.googleads.v16.services.ListInvoicesRequest\x1a\x37.google.ads.googleads.v16.services.ListInvoicesResponse\"b\xda\x41\x30\x63ustomer_id,billing_setup,issue_year,issue_month\x82\xd3\xe4\x93\x02)\x12\'/v16/customers/{customer_id=*}/invoices\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\xff\x01\n%com.google.ads.googleads.v16.servicesB\x13InvoiceServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.Invoice", "google/ads/googleads/v16/resources/invoice.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + ListInvoicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListInvoicesRequest").msgclass + ListInvoicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListInvoicesResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/invoice_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/invoice_service_services_pb.rb new file mode 100644 index 000000000..1131b4c40 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/invoice_service_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/invoice_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/invoice_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module InvoiceService + # Proto file describing the Invoice service. + # + # A service to fetch invoices issued for a billing setup during a given month. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.InvoiceService' + + # Returns all invoices associated with a billing setup, for a given month. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [InvoiceError]() + # [QuotaError]() + # [RequestError]() + rpc :ListInvoices, ::Google::Ads::GoogleAds::V16::Services::ListInvoicesRequest, ::Google::Ads::GoogleAds::V16::Services::ListInvoicesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service.rb new file mode 100644 index 000000000..c93e27ce5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/credentials" +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/paths" +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage Keyword Plan ad group keywords. KeywordPlanAdGroup is + # required to add ad group keywords. Positive and negative keywords are + # supported. A maximum of 10,000 positive keywords are allowed per keyword + # plan. A maximum of 1,000 negative keywords are allower per keyword plan. This + # includes campaign negative keywords and ad group negative keywords. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service" + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client.new + # + module KeywordPlanAdGroupKeywordService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "keyword_plan_ad_group_keyword_service", "helpers.rb" +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/client.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/client.rb new file mode 100644 index 000000000..d88b2db4c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/client.rb @@ -0,0 +1,455 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanAdGroupKeywordService + ## + # Client for the KeywordPlanAdGroupKeywordService service. + # + # Service to manage Keyword Plan ad group keywords. KeywordPlanAdGroup is + # required to add ad group keywords. Positive and negative keywords are + # supported. A maximum of 10,000 positive keywords are allowed per keyword + # plan. A maximum of 1,000 negative keywords are allower per keyword plan. This + # includes campaign negative keywords and ad group negative keywords. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :keyword_plan_ad_group_keyword_service_stub + + ## + # Configure the KeywordPlanAdGroupKeywordService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KeywordPlanAdGroupKeywordService clients + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KeywordPlanAdGroupKeywordService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @keyword_plan_ad_group_keyword_service_stub.universe_domain + end + + ## + # Create a new KeywordPlanAdGroupKeywordService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KeywordPlanAdGroupKeywordService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @keyword_plan_ad_group_keyword_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes Keyword Plan ad group keywords. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanAdGroupKeywordError]() + # [KeywordPlanError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # + # @overload mutate_keyword_plan_ad_group_keywords(request, options = nil) + # Pass arguments to `mutate_keyword_plan_ad_group_keywords` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_keyword_plan_ad_group_keywords(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_keyword_plan_ad_group_keywords` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose Keyword Plan ad group keywords are + # being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordOperation, ::Hash>] + # Required. The list of operations to perform on individual Keyword Plan ad + # group keywords. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsRequest.new + # + # # Call the mutate_keyword_plan_ad_group_keywords method. + # result = client.mutate_keyword_plan_ad_group_keywords request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsResponse. + # p result + # + def mutate_keyword_plan_ad_group_keywords request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_keyword_plan_ad_group_keywords.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_keyword_plan_ad_group_keywords.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_keyword_plan_ad_group_keywords.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_ad_group_keyword_service_stub.call_rpc :mutate_keyword_plan_ad_group_keywords, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the KeywordPlanAdGroupKeywordService API. + # + # This class represents the configuration for KeywordPlanAdGroupKeywordService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_keyword_plan_ad_group_keywords to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plan_ad_group_keywords.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupKeywordService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plan_ad_group_keywords.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the KeywordPlanAdGroupKeywordService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_keyword_plan_ad_group_keywords` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_keyword_plan_ad_group_keywords + + # @private + def initialize parent_rpcs = nil + mutate_keyword_plan_ad_group_keywords_config = parent_rpcs.mutate_keyword_plan_ad_group_keywords if parent_rpcs.respond_to? :mutate_keyword_plan_ad_group_keywords + @mutate_keyword_plan_ad_group_keywords = ::Gapic::Config::Method.new mutate_keyword_plan_ad_group_keywords_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/credentials.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/credentials.rb new file mode 100644 index 000000000..c475350a4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanAdGroupKeywordService + # Credentials for the KeywordPlanAdGroupKeywordService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/paths.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/paths.rb new file mode 100644 index 000000000..4afbecf27 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanAdGroupKeywordService + # Path helper methods for the KeywordPlanAdGroupKeywordService API. + module Paths + ## + # Create a fully-qualified KeywordPlanAdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanAdGroups/{keyword_plan_ad_group_id}` + # + # @param customer_id [String] + # @param keyword_plan_ad_group_id [String] + # + # @return [::String] + def keyword_plan_ad_group_path customer_id:, keyword_plan_ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanAdGroups/#{keyword_plan_ad_group_id}" + end + + ## + # Create a fully-qualified KeywordPlanAdGroupKeyword resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanAdGroupKeywords/{keyword_plan_ad_group_keyword_id}` + # + # @param customer_id [String] + # @param keyword_plan_ad_group_keyword_id [String] + # + # @return [::String] + def keyword_plan_ad_group_keyword_path customer_id:, keyword_plan_ad_group_keyword_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanAdGroupKeywords/#{keyword_plan_ad_group_keyword_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_pb.rb new file mode 100644 index 000000000..3db0218c4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/keyword_plan_ad_group_keyword_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/keyword_plan_ad_group_keyword_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nMgoogle/ads/googleads/v16/services/keyword_plan_ad_group_keyword_service.proto\x12!google.ads.googleads.v16.services\x1a\x46google/ads/googleads/v16/resources/keyword_plan_ad_group_keyword.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xd3\x01\n\'MutateKeywordPlanAdGroupKeywordsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12^\n\noperations\x18\x02 \x03(\x0b\x32\x45.google.ads.googleads.v16.services.KeywordPlanAdGroupKeywordOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xcf\x02\n\"KeywordPlanAdGroupKeywordOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12O\n\x06\x63reate\x18\x01 \x01(\x0b\x32=.google.ads.googleads.v16.resources.KeywordPlanAdGroupKeywordH\x00\x12O\n\x06update\x18\x02 \x01(\x0b\x32=.google.ads.googleads.v16.resources.KeywordPlanAdGroupKeywordH\x00\x12I\n\x06remove\x18\x03 \x01(\tB7\xfa\x41\x34\n2googleads.googleapis.com/KeywordPlanAdGroupKeywordH\x00\x42\x0b\n\toperation\"\xb8\x01\n(MutateKeywordPlanAdGroupKeywordsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12Y\n\x07results\x18\x02 \x03(\x0b\x32H.google.ads.googleads.v16.services.MutateKeywordPlanAdGroupKeywordResult\"w\n%MutateKeywordPlanAdGroupKeywordResult\x12N\n\rresource_name\x18\x01 \x01(\tB7\xfa\x41\x34\n2googleads.googleapis.com/KeywordPlanAdGroupKeyword2\x8d\x03\n KeywordPlanAdGroupKeywordService\x12\xa1\x02\n MutateKeywordPlanAdGroupKeywords\x12J.google.ads.googleads.v16.services.MutateKeywordPlanAdGroupKeywordsRequest\x1aK.google.ads.googleads.v16.services.MutateKeywordPlanAdGroupKeywordsResponse\"d\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x45\"@/v16/customers/{customer_id=*}/keywordPlanAdGroupKeywords:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x91\x02\n%com.google.ads.googleads.v16.servicesB%KeywordPlanAdGroupKeywordServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.KeywordPlanAdGroupKeyword", "google/ads/googleads/v16/resources/keyword_plan_ad_group_keyword.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateKeywordPlanAdGroupKeywordsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanAdGroupKeywordsRequest").msgclass + KeywordPlanAdGroupKeywordOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.KeywordPlanAdGroupKeywordOperation").msgclass + MutateKeywordPlanAdGroupKeywordsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanAdGroupKeywordsResponse").msgclass + MutateKeywordPlanAdGroupKeywordResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanAdGroupKeywordResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_services_pb.rb new file mode 100644 index 000000000..a36009638 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_keyword_service_services_pb.rb @@ -0,0 +1,68 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/keyword_plan_ad_group_keyword_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/keyword_plan_ad_group_keyword_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanAdGroupKeywordService + # Proto file describing the keyword plan ad group keyword service. + # + # Service to manage Keyword Plan ad group keywords. KeywordPlanAdGroup is + # required to add ad group keywords. Positive and negative keywords are + # supported. A maximum of 10,000 positive keywords are allowed per keyword + # plan. A maximum of 1,000 negative keywords are allower per keyword plan. This + # includes campaign negative keywords and ad group negative keywords. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.KeywordPlanAdGroupKeywordService' + + # Creates, updates, or removes Keyword Plan ad group keywords. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanAdGroupKeywordError]() + # [KeywordPlanError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + rpc :MutateKeywordPlanAdGroupKeywords, ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupKeywordsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service.rb new file mode 100644 index 000000000..7519d20eb --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_service/credentials" +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_service/paths" +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage Keyword Plan ad groups. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/keyword_plan_ad_group_service" + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client.new + # + module KeywordPlanAdGroupService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "keyword_plan_ad_group_service", "helpers.rb" +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/client.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/client.rb new file mode 100644 index 000000000..9947851c0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/client.rb @@ -0,0 +1,453 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/keyword_plan_ad_group_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanAdGroupService + ## + # Client for the KeywordPlanAdGroupService service. + # + # Service to manage Keyword Plan ad groups. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :keyword_plan_ad_group_service_stub + + ## + # Configure the KeywordPlanAdGroupService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KeywordPlanAdGroupService clients + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KeywordPlanAdGroupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @keyword_plan_ad_group_service_stub.universe_domain + end + + ## + # Create a new KeywordPlanAdGroupService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KeywordPlanAdGroupService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/keyword_plan_ad_group_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @keyword_plan_ad_group_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes Keyword Plan ad groups. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanAdGroupError]() + # [KeywordPlanError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # + # @overload mutate_keyword_plan_ad_groups(request, options = nil) + # Pass arguments to `mutate_keyword_plan_ad_groups` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_keyword_plan_ad_groups(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_keyword_plan_ad_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose Keyword Plan ad groups are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupOperation, ::Hash>] + # Required. The list of operations to perform on individual Keyword Plan ad + # groups. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsRequest.new + # + # # Call the mutate_keyword_plan_ad_groups method. + # result = client.mutate_keyword_plan_ad_groups request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsResponse. + # p result + # + def mutate_keyword_plan_ad_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_keyword_plan_ad_groups.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_keyword_plan_ad_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_keyword_plan_ad_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_ad_group_service_stub.call_rpc :mutate_keyword_plan_ad_groups, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the KeywordPlanAdGroupService API. + # + # This class represents the configuration for KeywordPlanAdGroupService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_keyword_plan_ad_groups to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plan_ad_groups.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanAdGroupService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plan_ad_groups.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the KeywordPlanAdGroupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_keyword_plan_ad_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_keyword_plan_ad_groups + + # @private + def initialize parent_rpcs = nil + mutate_keyword_plan_ad_groups_config = parent_rpcs.mutate_keyword_plan_ad_groups if parent_rpcs.respond_to? :mutate_keyword_plan_ad_groups + @mutate_keyword_plan_ad_groups = ::Gapic::Config::Method.new mutate_keyword_plan_ad_groups_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/credentials.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/credentials.rb new file mode 100644 index 000000000..a3a767302 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanAdGroupService + # Credentials for the KeywordPlanAdGroupService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/paths.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/paths.rb new file mode 100644 index 000000000..8de9766ba --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanAdGroupService + # Path helper methods for the KeywordPlanAdGroupService API. + module Paths + ## + # Create a fully-qualified KeywordPlanAdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanAdGroups/{keyword_plan_ad_group_id}` + # + # @param customer_id [String] + # @param keyword_plan_ad_group_id [String] + # + # @return [::String] + def keyword_plan_ad_group_path customer_id:, keyword_plan_ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanAdGroups/#{keyword_plan_ad_group_id}" + end + + ## + # Create a fully-qualified KeywordPlanCampaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}` + # + # @param customer_id [String] + # @param keyword_plan_campaign_id [String] + # + # @return [::String] + def keyword_plan_campaign_path customer_id:, keyword_plan_campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanCampaigns/#{keyword_plan_campaign_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service_pb.rb new file mode 100644 index 000000000..fbfb7a04e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/keyword_plan_ad_group_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/keyword_plan_ad_group_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/services/keyword_plan_ad_group_service.proto\x12!google.ads.googleads.v16.services\x1a>google/ads/googleads/v16/resources/keyword_plan_ad_group.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xc5\x01\n MutateKeywordPlanAdGroupsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12W\n\noperations\x18\x02 \x03(\x0b\x32>.google.ads.googleads.v16.services.KeywordPlanAdGroupOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xb3\x02\n\x1bKeywordPlanAdGroupOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12H\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.KeywordPlanAdGroupH\x00\x12H\n\x06update\x18\x02 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.KeywordPlanAdGroupH\x00\x12\x42\n\x06remove\x18\x03 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/KeywordPlanAdGroupH\x00\x42\x0b\n\toperation\"\xaa\x01\n!MutateKeywordPlanAdGroupsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12R\n\x07results\x18\x02 \x03(\x0b\x32\x41.google.ads.googleads.v16.services.MutateKeywordPlanAdGroupResult\"i\n\x1eMutateKeywordPlanAdGroupResult\x12G\n\rresource_name\x18\x01 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/KeywordPlanAdGroup2\xea\x02\n\x19KeywordPlanAdGroupService\x12\x85\x02\n\x19MutateKeywordPlanAdGroups\x12\x43.google.ads.googleads.v16.services.MutateKeywordPlanAdGroupsRequest\x1a\x44.google.ads.googleads.v16.services.MutateKeywordPlanAdGroupsResponse\"]\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02>\"9/v16/customers/{customer_id=*}/keywordPlanAdGroups:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8a\x02\n%com.google.ads.googleads.v16.servicesB\x1eKeywordPlanAdGroupServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.KeywordPlanAdGroup", "google/ads/googleads/v16/resources/keyword_plan_ad_group.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateKeywordPlanAdGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanAdGroupsRequest").msgclass + KeywordPlanAdGroupOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.KeywordPlanAdGroupOperation").msgclass + MutateKeywordPlanAdGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanAdGroupsResponse").msgclass + MutateKeywordPlanAdGroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanAdGroupResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service_services_pb.rb new file mode 100644 index 000000000..7fa000847 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_ad_group_service_services_pb.rb @@ -0,0 +1,66 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/keyword_plan_ad_group_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/keyword_plan_ad_group_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanAdGroupService + # Proto file describing the keyword plan ad group service. + # + # Service to manage Keyword Plan ad groups. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.KeywordPlanAdGroupService' + + # Creates, updates, or removes Keyword Plan ad groups. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanAdGroupError]() + # [KeywordPlanError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + rpc :MutateKeywordPlanAdGroups, ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanAdGroupsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service.rb new file mode 100644 index 000000000..257dbe755 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/credentials" +require "google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/paths" +require "google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage Keyword Plan campaign keywords. KeywordPlanCampaign is + # required to add the campaign keywords. Only negative keywords are supported. + # A maximum of 1000 negative keywords are allowed per plan. This includes both + # campaign negative keywords and ad group negative keywords. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service" + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client.new + # + module KeywordPlanCampaignKeywordService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "keyword_plan_campaign_keyword_service", "helpers.rb" +require "google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/client.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/client.rb new file mode 100644 index 000000000..ea71c5349 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/client.rb @@ -0,0 +1,453 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanCampaignKeywordService + ## + # Client for the KeywordPlanCampaignKeywordService service. + # + # Service to manage Keyword Plan campaign keywords. KeywordPlanCampaign is + # required to add the campaign keywords. Only negative keywords are supported. + # A maximum of 1000 negative keywords are allowed per plan. This includes both + # campaign negative keywords and ad group negative keywords. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :keyword_plan_campaign_keyword_service_stub + + ## + # Configure the KeywordPlanCampaignKeywordService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KeywordPlanCampaignKeywordService clients + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KeywordPlanCampaignKeywordService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @keyword_plan_campaign_keyword_service_stub.universe_domain + end + + ## + # Create a new KeywordPlanCampaignKeywordService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KeywordPlanCampaignKeywordService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @keyword_plan_campaign_keyword_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes Keyword Plan campaign keywords. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanAdGroupKeywordError]() + # [KeywordPlanCampaignKeywordError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # + # @overload mutate_keyword_plan_campaign_keywords(request, options = nil) + # Pass arguments to `mutate_keyword_plan_campaign_keywords` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_keyword_plan_campaign_keywords(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_keyword_plan_campaign_keywords` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose campaign keywords are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordOperation, ::Hash>] + # Required. The list of operations to perform on individual Keyword Plan + # campaign keywords. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsRequest.new + # + # # Call the mutate_keyword_plan_campaign_keywords method. + # result = client.mutate_keyword_plan_campaign_keywords request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsResponse. + # p result + # + def mutate_keyword_plan_campaign_keywords request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_keyword_plan_campaign_keywords.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_keyword_plan_campaign_keywords.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_keyword_plan_campaign_keywords.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_campaign_keyword_service_stub.call_rpc :mutate_keyword_plan_campaign_keywords, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the KeywordPlanCampaignKeywordService API. + # + # This class represents the configuration for KeywordPlanCampaignKeywordService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_keyword_plan_campaign_keywords to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plan_campaign_keywords.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignKeywordService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plan_campaign_keywords.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the KeywordPlanCampaignKeywordService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_keyword_plan_campaign_keywords` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_keyword_plan_campaign_keywords + + # @private + def initialize parent_rpcs = nil + mutate_keyword_plan_campaign_keywords_config = parent_rpcs.mutate_keyword_plan_campaign_keywords if parent_rpcs.respond_to? :mutate_keyword_plan_campaign_keywords + @mutate_keyword_plan_campaign_keywords = ::Gapic::Config::Method.new mutate_keyword_plan_campaign_keywords_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/credentials.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/credentials.rb new file mode 100644 index 000000000..576e623da --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanCampaignKeywordService + # Credentials for the KeywordPlanCampaignKeywordService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/paths.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/paths.rb new file mode 100644 index 000000000..16ad900b0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanCampaignKeywordService + # Path helper methods for the KeywordPlanCampaignKeywordService API. + module Paths + ## + # Create a fully-qualified KeywordPlanCampaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}` + # + # @param customer_id [String] + # @param keyword_plan_campaign_id [String] + # + # @return [::String] + def keyword_plan_campaign_path customer_id:, keyword_plan_campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanCampaigns/#{keyword_plan_campaign_id}" + end + + ## + # Create a fully-qualified KeywordPlanCampaignKeyword resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanCampaignKeywords/{keyword_plan_campaign_keyword_id}` + # + # @param customer_id [String] + # @param keyword_plan_campaign_keyword_id [String] + # + # @return [::String] + def keyword_plan_campaign_keyword_path customer_id:, keyword_plan_campaign_keyword_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanCampaignKeywords/#{keyword_plan_campaign_keyword_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_pb.rb new file mode 100644 index 000000000..720b41b89 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/keyword_plan_campaign_keyword_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/keyword_plan_campaign_keyword_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nMgoogle/ads/googleads/v16/services/keyword_plan_campaign_keyword_service.proto\x12!google.ads.googleads.v16.services\x1a\x46google/ads/googleads/v16/resources/keyword_plan_campaign_keyword.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xd5\x01\n(MutateKeywordPlanCampaignKeywordsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12_\n\noperations\x18\x02 \x03(\x0b\x32\x46.google.ads.googleads.v16.services.KeywordPlanCampaignKeywordOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xd3\x02\n#KeywordPlanCampaignKeywordOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12P\n\x06\x63reate\x18\x01 \x01(\x0b\x32>.google.ads.googleads.v16.resources.KeywordPlanCampaignKeywordH\x00\x12P\n\x06update\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.resources.KeywordPlanCampaignKeywordH\x00\x12J\n\x06remove\x18\x03 \x01(\tB8\xfa\x41\x35\n3googleads.googleapis.com/KeywordPlanCampaignKeywordH\x00\x42\x0b\n\toperation\"\xba\x01\n)MutateKeywordPlanCampaignKeywordsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12Z\n\x07results\x18\x02 \x03(\x0b\x32I.google.ads.googleads.v16.services.MutateKeywordPlanCampaignKeywordResult\"y\n&MutateKeywordPlanCampaignKeywordResult\x12O\n\rresource_name\x18\x01 \x01(\tB8\xfa\x41\x35\n3googleads.googleapis.com/KeywordPlanCampaignKeyword2\x92\x03\n!KeywordPlanCampaignKeywordService\x12\xa5\x02\n!MutateKeywordPlanCampaignKeywords\x12K.google.ads.googleads.v16.services.MutateKeywordPlanCampaignKeywordsRequest\x1aL.google.ads.googleads.v16.services.MutateKeywordPlanCampaignKeywordsResponse\"e\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x46\"A/v16/customers/{customer_id=*}/keywordPlanCampaignKeywords:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x92\x02\n%com.google.ads.googleads.v16.servicesB&KeywordPlanCampaignKeywordServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.KeywordPlanCampaignKeyword", "google/ads/googleads/v16/resources/keyword_plan_campaign_keyword.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateKeywordPlanCampaignKeywordsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanCampaignKeywordsRequest").msgclass + KeywordPlanCampaignKeywordOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.KeywordPlanCampaignKeywordOperation").msgclass + MutateKeywordPlanCampaignKeywordsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanCampaignKeywordsResponse").msgclass + MutateKeywordPlanCampaignKeywordResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanCampaignKeywordResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_services_pb.rb new file mode 100644 index 000000000..6aa21dea5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_keyword_service_services_pb.rb @@ -0,0 +1,66 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/keyword_plan_campaign_keyword_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/keyword_plan_campaign_keyword_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanCampaignKeywordService + # Proto file describing the keyword plan campaign keyword service. + # + # Service to manage Keyword Plan campaign keywords. KeywordPlanCampaign is + # required to add the campaign keywords. Only negative keywords are supported. + # A maximum of 1000 negative keywords are allowed per plan. This includes both + # campaign negative keywords and ad group negative keywords. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.KeywordPlanCampaignKeywordService' + + # Creates, updates, or removes Keyword Plan campaign keywords. Operation + # statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanAdGroupKeywordError]() + # [KeywordPlanCampaignKeywordError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + rpc :MutateKeywordPlanCampaignKeywords, ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignKeywordsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service.rb new file mode 100644 index 000000000..7b448afe8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/keyword_plan_campaign_service/credentials" +require "google/ads/google_ads/v16/services/keyword_plan_campaign_service/paths" +require "google/ads/google_ads/v16/services/keyword_plan_campaign_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage Keyword Plan campaigns. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/keyword_plan_campaign_service" + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client.new + # + module KeywordPlanCampaignService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "keyword_plan_campaign_service", "helpers.rb" +require "google/ads/google_ads/v16/services/keyword_plan_campaign_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/client.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/client.rb new file mode 100644 index 000000000..418f9554f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/client.rb @@ -0,0 +1,454 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/keyword_plan_campaign_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanCampaignService + ## + # Client for the KeywordPlanCampaignService service. + # + # Service to manage Keyword Plan campaigns. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :keyword_plan_campaign_service_stub + + ## + # Configure the KeywordPlanCampaignService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KeywordPlanCampaignService clients + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KeywordPlanCampaignService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @keyword_plan_campaign_service_stub.universe_domain + end + + ## + # Create a new KeywordPlanCampaignService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KeywordPlanCampaignService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/keyword_plan_campaign_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @keyword_plan_campaign_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes Keyword Plan campaigns. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanCampaignError]() + # [KeywordPlanError]() + # [ListOperationError]() + # [MutateError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # + # @overload mutate_keyword_plan_campaigns(request, options = nil) + # Pass arguments to `mutate_keyword_plan_campaigns` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_keyword_plan_campaigns(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_keyword_plan_campaigns` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose Keyword Plan campaigns are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignOperation, ::Hash>] + # Required. The list of operations to perform on individual Keyword Plan + # campaigns. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsRequest.new + # + # # Call the mutate_keyword_plan_campaigns method. + # result = client.mutate_keyword_plan_campaigns request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsResponse. + # p result + # + def mutate_keyword_plan_campaigns request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_keyword_plan_campaigns.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_keyword_plan_campaigns.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_keyword_plan_campaigns.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_campaign_service_stub.call_rpc :mutate_keyword_plan_campaigns, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the KeywordPlanCampaignService API. + # + # This class represents the configuration for KeywordPlanCampaignService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_keyword_plan_campaigns to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plan_campaigns.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanCampaignService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plan_campaigns.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the KeywordPlanCampaignService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_keyword_plan_campaigns` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_keyword_plan_campaigns + + # @private + def initialize parent_rpcs = nil + mutate_keyword_plan_campaigns_config = parent_rpcs.mutate_keyword_plan_campaigns if parent_rpcs.respond_to? :mutate_keyword_plan_campaigns + @mutate_keyword_plan_campaigns = ::Gapic::Config::Method.new mutate_keyword_plan_campaigns_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/credentials.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/credentials.rb new file mode 100644 index 000000000..fa1ef0428 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanCampaignService + # Credentials for the KeywordPlanCampaignService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/paths.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/paths.rb new file mode 100644 index 000000000..70d2cd34d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service/paths.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanCampaignService + # Path helper methods for the KeywordPlanCampaignService API. + module Paths + ## + # Create a fully-qualified GeoTargetConstant resource string. + # + # The resource will be in the following format: + # + # `geoTargetConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def geo_target_constant_path criterion_id: + "geoTargetConstants/#{criterion_id}" + end + + ## + # Create a fully-qualified KeywordPlan resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlans/{keyword_plan_id}` + # + # @param customer_id [String] + # @param keyword_plan_id [String] + # + # @return [::String] + def keyword_plan_path customer_id:, keyword_plan_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlans/#{keyword_plan_id}" + end + + ## + # Create a fully-qualified KeywordPlanCampaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}` + # + # @param customer_id [String] + # @param keyword_plan_campaign_id [String] + # + # @return [::String] + def keyword_plan_campaign_path customer_id:, keyword_plan_campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlanCampaigns/#{keyword_plan_campaign_id}" + end + + ## + # Create a fully-qualified LanguageConstant resource string. + # + # The resource will be in the following format: + # + # `languageConstants/{criterion_id}` + # + # @param criterion_id [String] + # + # @return [::String] + def language_constant_path criterion_id: + "languageConstants/#{criterion_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service_pb.rb new file mode 100644 index 000000000..0a73585b3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/keyword_plan_campaign_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/keyword_plan_campaign_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/services/keyword_plan_campaign_service.proto\x12!google.ads.googleads.v16.services\x1a>google/ads/googleads/v16/resources/keyword_plan_campaign.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xc7\x01\n!MutateKeywordPlanCampaignsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12X\n\noperations\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.services.KeywordPlanCampaignOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xb7\x02\n\x1cKeywordPlanCampaignOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12I\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.KeywordPlanCampaignH\x00\x12I\n\x06update\x18\x02 \x01(\x0b\x32\x37.google.ads.googleads.v16.resources.KeywordPlanCampaignH\x00\x12\x43\n\x06remove\x18\x03 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/KeywordPlanCampaignH\x00\x42\x0b\n\toperation\"\xac\x01\n\"MutateKeywordPlanCampaignsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12S\n\x07results\x18\x02 \x03(\x0b\x32\x42.google.ads.googleads.v16.services.MutateKeywordPlanCampaignResult\"k\n\x1fMutateKeywordPlanCampaignResult\x12H\n\rresource_name\x18\x01 \x01(\tB1\xfa\x41.\n,googleads.googleapis.com/KeywordPlanCampaign2\xef\x02\n\x1aKeywordPlanCampaignService\x12\x89\x02\n\x1aMutateKeywordPlanCampaigns\x12\x44.google.ads.googleads.v16.services.MutateKeywordPlanCampaignsRequest\x1a\x45.google.ads.googleads.v16.services.MutateKeywordPlanCampaignsResponse\"^\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02?\":/v16/customers/{customer_id=*}/keywordPlanCampaigns:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8b\x02\n%com.google.ads.googleads.v16.servicesB\x1fKeywordPlanCampaignServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.KeywordPlanCampaign", "google/ads/googleads/v16/resources/keyword_plan_campaign.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateKeywordPlanCampaignsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanCampaignsRequest").msgclass + KeywordPlanCampaignOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.KeywordPlanCampaignOperation").msgclass + MutateKeywordPlanCampaignsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanCampaignsResponse").msgclass + MutateKeywordPlanCampaignResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateKeywordPlanCampaignResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service_services_pb.rb new file mode 100644 index 000000000..7830c6fa7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_campaign_service_services_pb.rb @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/keyword_plan_campaign_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/keyword_plan_campaign_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanCampaignService + # Proto file describing the keyword plan campaign service. + # + # Service to manage Keyword Plan campaigns. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.KeywordPlanCampaignService' + + # Creates, updates, or removes Keyword Plan campaigns. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanCampaignError]() + # [KeywordPlanError]() + # [ListOperationError]() + # [MutateError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + rpc :MutateKeywordPlanCampaigns, ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlanCampaignsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service.rb new file mode 100644 index 000000000..f92229e66 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/keyword_plan_idea_service/credentials" +require "google/ads/google_ads/v16/services/keyword_plan_idea_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to generate keyword ideas. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/keyword_plan_idea_service" + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.new + # + module KeywordPlanIdeaService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "keyword_plan_idea_service", "helpers.rb" +require "google/ads/google_ads/v16/services/keyword_plan_idea_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service/client.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service/client.rb new file mode 100644 index 000000000..123d3ac78 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service/client.rb @@ -0,0 +1,833 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/keyword_plan_idea_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanIdeaService + ## + # Client for the KeywordPlanIdeaService service. + # + # Service to generate keyword ideas. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :keyword_plan_idea_service_stub + + ## + # Configure the KeywordPlanIdeaService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KeywordPlanIdeaService clients + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KeywordPlanIdeaService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @keyword_plan_idea_service_stub.universe_domain + end + + ## + # Create a new KeywordPlanIdeaService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KeywordPlanIdeaService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/keyword_plan_idea_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @keyword_plan_idea_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns a list of keyword ideas. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanIdeaError]() + # [QuotaError]() + # [RequestError]() + # + # @overload generate_keyword_ideas(request, options = nil) + # Pass arguments to `generate_keyword_ideas` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeasRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_keyword_ideas(customer_id: nil, language: nil, geo_target_constants: nil, include_adult_keywords: nil, page_token: nil, page_size: nil, keyword_plan_network: nil, keyword_annotation: nil, aggregate_metrics: nil, historical_metrics_options: nil, keyword_and_url_seed: nil, keyword_seed: nil, url_seed: nil, site_seed: nil) + # Pass arguments to `generate_keyword_ideas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # The ID of the customer with the recommendation. + # @param language [::String] + # The resource name of the language to target. + # Each keyword belongs to some set of languages; a keyword is included if + # language is one of its languages. + # If not set, all keywords will be included. + # @param geo_target_constants [::Array<::String>] + # The resource names of the location to target. Maximum is 10. + # An empty list MAY be used to specify all targeting geos. + # @param include_adult_keywords [::Boolean] + # If true, adult keywords will be included in response. + # The default value is false. + # @param page_token [::String] + # Token of the page to retrieve. If not specified, the first + # page of results will be returned. To request next page of results use the + # value obtained from `next_page_token` in the previous response. + # The request fields must match across pages. + # @param page_size [::Integer] + # Number of results to retrieve in a single page. + # A maximum of 10,000 results may be returned, if the page_size + # exceeds this, it is ignored. + # If unspecified, at most 10,000 results will be returned. + # The server may decide to further limit the number of returned resources. + # If the response contains fewer than 10,000 results it may not be assumed + # as last page of results. + # @param keyword_plan_network [::Google::Ads::GoogleAds::V16::Enums::KeywordPlanNetworkEnum::KeywordPlanNetwork] + # Targeting network. + # If not set, Google Search And Partners Network will be used. + # @param keyword_annotation [::Array<::Google::Ads::GoogleAds::V16::Enums::KeywordPlanKeywordAnnotationEnum::KeywordPlanKeywordAnnotation>] + # The keyword annotations to include in response. + # @param aggregate_metrics [::Google::Ads::GoogleAds::V16::Common::KeywordPlanAggregateMetrics, ::Hash] + # The aggregate fields to include in response. + # @param historical_metrics_options [::Google::Ads::GoogleAds::V16::Common::HistoricalMetricsOptions, ::Hash] + # The options for historical metrics data. + # @param keyword_and_url_seed [::Google::Ads::GoogleAds::V16::Services::KeywordAndUrlSeed, ::Hash] + # A Keyword and a specific Url to generate ideas from + # for example, cars, www.example.com/cars. + # @param keyword_seed [::Google::Ads::GoogleAds::V16::Services::KeywordSeed, ::Hash] + # A Keyword or phrase to generate ideas from, for example, cars. + # @param url_seed [::Google::Ads::GoogleAds::V16::Services::UrlSeed, ::Hash] + # A specific url to generate ideas from, for example, www.example.com/cars. + # @param site_seed [::Google::Ads::GoogleAds::V16::Services::SiteSeed, ::Hash] + # The site to generate ideas from, for example, www.example.com. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeaResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeaResult>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeasRequest.new + # + # # Call the generate_keyword_ideas method. + # result = client.generate_keyword_ideas request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeaResult. + # p item + # end + # + def generate_keyword_ideas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeasRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_keyword_ideas.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_keyword_ideas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_keyword_ideas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_idea_service_stub.call_rpc :generate_keyword_ideas, request, + options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @keyword_plan_idea_service_stub, :generate_keyword_ideas, + request, response, operation, options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns a list of keyword historical metrics. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload generate_keyword_historical_metrics(request, options = nil) + # Pass arguments to `generate_keyword_historical_metrics` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_keyword_historical_metrics(customer_id: nil, keywords: nil, language: nil, include_adult_keywords: nil, geo_target_constants: nil, keyword_plan_network: nil, aggregate_metrics: nil, historical_metrics_options: nil) + # Pass arguments to `generate_keyword_historical_metrics` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # The ID of the customer with the recommendation. + # @param keywords [::Array<::String>] + # A list of keywords to get historical metrics. + # Not all inputs will be returned as a result of near-exact deduplication. + # For example, if stats for "car" and "cars" are requested, only "car" will + # be returned. + # A maximum of 10,000 keywords can be used. + # @param language [::String] + # The resource name of the language to target. + # Each keyword belongs to some set of languages; a keyword is included if + # language is one of its languages. + # If not set, all keywords will be included. + # @param include_adult_keywords [::Boolean] + # If true, adult keywords will be included in response. + # The default value is false. + # @param geo_target_constants [::Array<::String>] + # The resource names of the location to target. Maximum is 10. + # An empty list MAY be used to specify all targeting geos. + # @param keyword_plan_network [::Google::Ads::GoogleAds::V16::Enums::KeywordPlanNetworkEnum::KeywordPlanNetwork] + # Targeting network. + # If not set, Google Search And Partners Network will be used. + # @param aggregate_metrics [::Google::Ads::GoogleAds::V16::Common::KeywordPlanAggregateMetrics, ::Hash] + # The aggregate fields to include in response. + # @param historical_metrics_options [::Google::Ads::GoogleAds::V16::Common::HistoricalMetricsOptions, ::Hash] + # The options for historical metrics data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsRequest.new + # + # # Call the generate_keyword_historical_metrics method. + # result = client.generate_keyword_historical_metrics request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsResponse. + # p result + # + def generate_keyword_historical_metrics request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_keyword_historical_metrics.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_keyword_historical_metrics.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_keyword_historical_metrics.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_idea_service_stub.call_rpc :generate_keyword_historical_metrics, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns a list of suggested AdGroups and suggested modifications + # (text, match type) for the given keywords. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload generate_ad_group_themes(request, options = nil) + # Pass arguments to `generate_ad_group_themes` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_ad_group_themes(customer_id: nil, keywords: nil, ad_groups: nil) + # Pass arguments to `generate_ad_group_themes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param keywords [::Array<::String>] + # Required. A list of keywords to group into the provided AdGroups. + # @param ad_groups [::Array<::String>] + # Required. A list of resource names of AdGroups to group keywords into. + # Resource name format: `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesRequest.new + # + # # Call the generate_ad_group_themes method. + # result = client.generate_ad_group_themes request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesResponse. + # p result + # + def generate_ad_group_themes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_ad_group_themes.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_ad_group_themes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_ad_group_themes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_idea_service_stub.call_rpc :generate_ad_group_themes, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns metrics (such as impressions, clicks, total cost) of a keyword + # forecast for the given campaign. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload generate_keyword_forecast_metrics(request, options = nil) + # Pass arguments to `generate_keyword_forecast_metrics` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_keyword_forecast_metrics(customer_id: nil, currency_code: nil, forecast_period: nil, campaign: nil) + # Pass arguments to `generate_keyword_forecast_metrics` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # The ID of the customer. + # @param currency_code [::String] + # The currency used for exchange rate conversion. + # By default, the account currency of the customer is used. + # Set this field only if the currency is different from the account currency. + # The list of valid currency codes can be found at + # https://developers.google.com/google-ads/api/data/codes-formats#currency-codes. + # @param forecast_period [::Google::Ads::GoogleAds::V16::Common::DateRange, ::Hash] + # The date range for the forecast. The start date must be in the future and + # end date must be within 1 year from today. The reference timezone used is + # the one of the Google Ads account belonging to the customer. If not set, a + # default date range from next Sunday to the following Saturday will be used. + # @param campaign [::Google::Ads::GoogleAds::V16::Services::CampaignToForecast, ::Hash] + # Required. The campaign used in the forecast. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsRequest.new + # + # # Call the generate_keyword_forecast_metrics method. + # result = client.generate_keyword_forecast_metrics request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsResponse. + # p result + # + def generate_keyword_forecast_metrics request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_keyword_forecast_metrics.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_keyword_forecast_metrics.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_keyword_forecast_metrics.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_idea_service_stub.call_rpc :generate_keyword_forecast_metrics, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the KeywordPlanIdeaService API. + # + # This class represents the configuration for KeywordPlanIdeaService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # generate_keyword_ideas to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.generate_keyword_ideas.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanIdeaService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.generate_keyword_ideas.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the KeywordPlanIdeaService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `generate_keyword_ideas` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_keyword_ideas + ## + # RPC-specific configuration for `generate_keyword_historical_metrics` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_keyword_historical_metrics + ## + # RPC-specific configuration for `generate_ad_group_themes` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_ad_group_themes + ## + # RPC-specific configuration for `generate_keyword_forecast_metrics` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_keyword_forecast_metrics + + # @private + def initialize parent_rpcs = nil + generate_keyword_ideas_config = parent_rpcs.generate_keyword_ideas if parent_rpcs.respond_to? :generate_keyword_ideas + @generate_keyword_ideas = ::Gapic::Config::Method.new generate_keyword_ideas_config + generate_keyword_historical_metrics_config = parent_rpcs.generate_keyword_historical_metrics if parent_rpcs.respond_to? :generate_keyword_historical_metrics + @generate_keyword_historical_metrics = ::Gapic::Config::Method.new generate_keyword_historical_metrics_config + generate_ad_group_themes_config = parent_rpcs.generate_ad_group_themes if parent_rpcs.respond_to? :generate_ad_group_themes + @generate_ad_group_themes = ::Gapic::Config::Method.new generate_ad_group_themes_config + generate_keyword_forecast_metrics_config = parent_rpcs.generate_keyword_forecast_metrics if parent_rpcs.respond_to? :generate_keyword_forecast_metrics + @generate_keyword_forecast_metrics = ::Gapic::Config::Method.new generate_keyword_forecast_metrics_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service/credentials.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service/credentials.rb new file mode 100644 index 000000000..d4b51a1ca --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanIdeaService + # Credentials for the KeywordPlanIdeaService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service_pb.rb new file mode 100644 index 000000000..123a175ac --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service_pb.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/keyword_plan_idea_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/common/dates_pb' +require 'google/ads/google_ads/v16/common/keyword_plan_common_pb' +require 'google/ads/google_ads/v16/enums/keyword_match_type_pb' +require 'google/ads/google_ads/v16/enums/keyword_plan_keyword_annotation_pb' +require 'google/ads/google_ads/v16/enums/keyword_plan_network_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\nAgoogle/ads/googleads/v16/services/keyword_plan_idea_service.proto\x12!google.ads.googleads.v16.services\x1a.google/ads/googleads/v16/common/criteria.proto\x1a+google/ads/googleads/v16/common/dates.proto\x1a\x39google/ads/googleads/v16/common/keyword_plan_common.proto\x1a\x37google/ads/googleads/v16/enums/keyword_match_type.proto\x1a\x44google/ads/googleads/v16/enums/keyword_plan_keyword_annotation.proto\x1a\x39google/ads/googleads/v16/enums/keyword_plan_network.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"\xff\x06\n\x1bGenerateKeywordIdeasRequest\x12\x13\n\x0b\x63ustomer_id\x18\x01 \x01(\t\x12\x15\n\x08language\x18\x0e \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x14geo_target_constants\x18\x0f \x03(\t\x12\x1e\n\x16include_adult_keywords\x18\n \x01(\x08\x12\x12\n\npage_token\x18\x0c \x01(\t\x12\x11\n\tpage_size\x18\r \x01(\x05\x12g\n\x14keyword_plan_network\x18\t \x01(\x0e\x32I.google.ads.googleads.v16.enums.KeywordPlanNetworkEnum.KeywordPlanNetwork\x12y\n\x12keyword_annotation\x18\x11 \x03(\x0e\x32].google.ads.googleads.v16.enums.KeywordPlanKeywordAnnotationEnum.KeywordPlanKeywordAnnotation\x12W\n\x11\x61ggregate_metrics\x18\x10 \x01(\x0b\x32<.google.ads.googleads.v16.common.KeywordPlanAggregateMetrics\x12]\n\x1ahistorical_metrics_options\x18\x12 \x01(\x0b\x32\x39.google.ads.googleads.v16.common.HistoricalMetricsOptions\x12T\n\x14keyword_and_url_seed\x18\x02 \x01(\x0b\x32\x34.google.ads.googleads.v16.services.KeywordAndUrlSeedH\x00\x12\x46\n\x0ckeyword_seed\x18\x03 \x01(\x0b\x32..google.ads.googleads.v16.services.KeywordSeedH\x00\x12>\n\x08url_seed\x18\x05 \x01(\x0b\x32*.google.ads.googleads.v16.services.UrlSeedH\x00\x12@\n\tsite_seed\x18\x0b \x01(\x0b\x32+.google.ads.googleads.v16.services.SiteSeedH\x00\x42\x06\n\x04seedB\x0b\n\t_language\"?\n\x11KeywordAndUrlSeed\x12\x10\n\x03url\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x08keywords\x18\x04 \x03(\tB\x06\n\x04_url\"\x1f\n\x0bKeywordSeed\x12\x10\n\x08keywords\x18\x02 \x03(\t\"&\n\x08SiteSeed\x12\x11\n\x04site\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_site\"#\n\x07UrlSeed\x12\x10\n\x03url\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x06\n\x04_url\"\xff\x01\n\x1bGenerateKeywordIdeaResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.ads.googleads.v16.services.GenerateKeywordIdeaResult\x12\x64\n\x18\x61ggregate_metric_results\x18\x04 \x01(\x0b\x32\x42.google.ads.googleads.v16.common.KeywordPlanAggregateMetricResults\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x03\"\xfe\x01\n\x19GenerateKeywordIdeaResult\x12\x11\n\x04text\x18\x05 \x01(\tH\x00\x88\x01\x01\x12[\n\x14keyword_idea_metrics\x18\x03 \x01(\x0b\x32=.google.ads.googleads.v16.common.KeywordPlanHistoricalMetrics\x12P\n\x13keyword_annotations\x18\x06 \x01(\x0b\x32\x33.google.ads.googleads.v16.common.KeywordAnnotations\x12\x16\n\x0e\x63lose_variants\x18\x07 \x03(\tB\x07\n\x05_text\"\xd3\x03\n\'GenerateKeywordHistoricalMetricsRequest\x12\x13\n\x0b\x63ustomer_id\x18\x01 \x01(\t\x12\x10\n\x08keywords\x18\x02 \x03(\t\x12\x15\n\x08language\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x16include_adult_keywords\x18\x05 \x01(\x08\x12\x1c\n\x14geo_target_constants\x18\x06 \x03(\t\x12g\n\x14keyword_plan_network\x18\x07 \x01(\x0e\x32I.google.ads.googleads.v16.enums.KeywordPlanNetworkEnum.KeywordPlanNetwork\x12W\n\x11\x61ggregate_metrics\x18\x08 \x01(\x0b\x32<.google.ads.googleads.v16.common.KeywordPlanAggregateMetrics\x12]\n\x1ahistorical_metrics_options\x18\x03 \x01(\x0b\x32\x39.google.ads.googleads.v16.common.HistoricalMetricsOptionsB\x0b\n\t_language\"\xec\x01\n(GenerateKeywordHistoricalMetricsResponse\x12Z\n\x07results\x18\x01 \x03(\x0b\x32I.google.ads.googleads.v16.services.GenerateKeywordHistoricalMetricsResult\x12\x64\n\x18\x61ggregate_metric_results\x18\x02 \x01(\x0b\x32\x42.google.ads.googleads.v16.common.KeywordPlanAggregateMetricResults\"\xb4\x01\n&GenerateKeywordHistoricalMetricsResult\x12\x11\n\x04text\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0e\x63lose_variants\x18\x03 \x03(\t\x12V\n\x0fkeyword_metrics\x18\x02 \x01(\x0b\x32=.google.ads.googleads.v16.common.KeywordPlanHistoricalMetricsB\x07\n\x05_text\"g\n\x1cGenerateAdGroupThemesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08keywords\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x16\n\tad_groups\x18\x03 \x03(\tB\x03\xe0\x41\x02\"\xd2\x01\n\x1dGenerateAdGroupThemesResponse\x12\x61\n\x1c\x61\x64_group_keyword_suggestions\x18\x01 \x03(\x0b\x32;.google.ads.googleads.v16.services.AdGroupKeywordSuggestion\x12N\n\x12unusable_ad_groups\x18\x02 \x03(\x0b\x32\x32.google.ads.googleads.v16.services.UnusableAdGroup\"\xed\x01\n\x18\x41\x64GroupKeywordSuggestion\x12\x14\n\x0ckeyword_text\x18\x01 \x01(\t\x12\x1e\n\x16suggested_keyword_text\x18\x02 \x01(\t\x12\x63\n\x14suggested_match_type\x18\x03 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.KeywordMatchTypeEnum.KeywordMatchType\x12\x1a\n\x12suggested_ad_group\x18\x04 \x01(\t\x12\x1a\n\x12suggested_campaign\x18\x05 \x01(\t\"5\n\x0fUnusableAdGroup\x12\x10\n\x08\x61\x64_group\x18\x01 \x01(\t\x12\x10\n\x08\x63\x61mpaign\x18\x02 \x01(\t\"\xfd\x01\n%GenerateKeywordForecastMetricsRequest\x12\x13\n\x0b\x63ustomer_id\x18\x01 \x01(\t\x12\x1a\n\rcurrency_code\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x43\n\x0f\x66orecast_period\x18\x03 \x01(\x0b\x32*.google.ads.googleads.v16.common.DateRange\x12L\n\x08\x63\x61mpaign\x18\x04 \x01(\x0b\x32\x35.google.ads.googleads.v16.services.CampaignToForecastB\x03\xe0\x41\x02\x42\x10\n\x0e_currency_code\"\x98\x07\n\x12\x43\x61mpaignToForecast\x12\x1a\n\x12language_constants\x18\x01 \x03(\t\x12N\n\rgeo_modifiers\x18\x02 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.CriterionBidModifier\x12l\n\x14keyword_plan_network\x18\x03 \x01(\x0e\x32I.google.ads.googleads.v16.enums.KeywordPlanNetworkEnum.KeywordPlanNetworkB\x03\xe0\x41\x02\x12G\n\x11negative_keywords\x18\x04 \x03(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfo\x12l\n\x10\x62idding_strategy\x18\x05 \x01(\x0b\x32M.google.ads.googleads.v16.services.CampaignToForecast.CampaignBiddingStrategyB\x03\xe0\x41\x02\x12\x1c\n\x0f\x63onversion_rate\x18\x06 \x01(\x01H\x00\x88\x01\x01\x12\x45\n\tad_groups\x18\x07 \x03(\x0b\x32\x32.google.ads.googleads.v16.services.ForecastAdGroup\x1a\xf7\x02\n\x17\x43\x61mpaignBiddingStrategy\x12\x62\n\x1bmanual_cpc_bidding_strategy\x18\x01 \x01(\x0b\x32;.google.ads.googleads.v16.services.ManualCpcBiddingStrategyH\x00\x12l\n maximize_clicks_bidding_strategy\x18\x02 \x01(\x0b\x32@.google.ads.googleads.v16.services.MaximizeClicksBiddingStrategyH\x00\x12v\n%maximize_conversions_bidding_strategy\x18\x03 \x01(\x0b\x32\x45.google.ads.googleads.v16.services.MaximizeConversionsBiddingStrategyH\x00\x42\x12\n\x10\x62idding_strategyB\x12\n\x10_conversion_rate\"\xe6\x01\n\x0f\x46orecastAdGroup\x12\x1f\n\x12max_cpc_bid_micros\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12R\n\x11\x62iddable_keywords\x18\x02 \x03(\x0b\x32\x32.google.ads.googleads.v16.services.BiddableKeywordB\x03\xe0\x41\x02\x12G\n\x11negative_keywords\x18\x03 \x03(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x15\n\x13_max_cpc_bid_micros\"\x8d\x01\n\x0f\x42iddableKeyword\x12\x42\n\x07keyword\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x02\x12\x1f\n\x12max_cpc_bid_micros\x18\x02 \x01(\x03H\x00\x88\x01\x01\x42\x15\n\x13_max_cpc_bid_micros\"_\n\x14\x43riterionBidModifier\x12\x1b\n\x13geo_target_constant\x18\x01 \x01(\t\x12\x19\n\x0c\x62id_modifier\x18\x02 \x01(\x01H\x00\x88\x01\x01\x42\x0f\n\r_bid_modifier\"u\n\x18ManualCpcBiddingStrategy\x12 \n\x13\x64\x61ily_budget_micros\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x1f\n\x12max_cpc_bid_micros\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x42\x16\n\x14_daily_budget_micros\"\x8f\x01\n\x1dMaximizeClicksBiddingStrategy\x12&\n\x19\x64\x61ily_target_spend_micros\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\'\n\x1amax_cpc_bid_ceiling_micros\x18\x02 \x01(\x03H\x00\x88\x01\x01\x42\x1d\n\x1b_max_cpc_bid_ceiling_micros\"L\n\"MaximizeConversionsBiddingStrategy\x12&\n\x19\x64\x61ily_target_spend_micros\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\"\xa9\x01\n&GenerateKeywordForecastMetricsResponse\x12\x61\n\x19\x63\x61mpaign_forecast_metrics\x18\x01 \x01(\x0b\x32\x39.google.ads.googleads.v16.services.KeywordForecastMetricsH\x00\x88\x01\x01\x42\x1c\n\x1a_campaign_forecast_metrics\"\x90\x03\n\x16KeywordForecastMetrics\x12\x18\n\x0bimpressions\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x1f\n\x12\x63lick_through_rate\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x1f\n\x12\x61verage_cpc_micros\x18\x03 \x01(\x03H\x02\x88\x01\x01\x12\x13\n\x06\x63licks\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x18\n\x0b\x63ost_micros\x18\x05 \x01(\x03H\x04\x88\x01\x01\x12\x18\n\x0b\x63onversions\x18\x06 \x01(\x01H\x05\x88\x01\x01\x12\x1c\n\x0f\x63onversion_rate\x18\x07 \x01(\x01H\x06\x88\x01\x01\x12\x1f\n\x12\x61verage_cpa_micros\x18\x08 \x01(\x03H\x07\x88\x01\x01\x42\x0e\n\x0c_impressionsB\x15\n\x13_click_through_rateB\x15\n\x13_average_cpc_microsB\t\n\x07_clicksB\x0e\n\x0c_cost_microsB\x0e\n\x0c_conversionsB\x12\n\x10_conversion_rateB\x15\n\x13_average_cpa_micros2\xa2\x08\n\x16KeywordPlanIdeaService\x12\xd6\x01\n\x14GenerateKeywordIdeas\x12>.google.ads.googleads.v16.services.GenerateKeywordIdeasRequest\x1a>.google.ads.googleads.v16.services.GenerateKeywordIdeaResponse\">\x82\xd3\xe4\x93\x02\x38\"3/v16/customers/{customer_id=*}:generateKeywordIdeas:\x01*\x12\x87\x02\n GenerateKeywordHistoricalMetrics\x12J.google.ads.googleads.v16.services.GenerateKeywordHistoricalMetricsRequest\x1aK.google.ads.googleads.v16.services.GenerateKeywordHistoricalMetricsResponse\"J\x82\xd3\xe4\x93\x02\x44\"?/v16/customers/{customer_id=*}:generateKeywordHistoricalMetrics:\x01*\x12\xdb\x01\n\x15GenerateAdGroupThemes\x12?.google.ads.googleads.v16.services.GenerateAdGroupThemesRequest\x1a@.google.ads.googleads.v16.services.GenerateAdGroupThemesResponse\"?\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}:generateAdGroupThemes:\x01*\x12\xff\x01\n\x1eGenerateKeywordForecastMetrics\x12H.google.ads.googleads.v16.services.GenerateKeywordForecastMetricsRequest\x1aI.google.ads.googleads.v16.services.GenerateKeywordForecastMetricsResponse\"H\x82\xd3\xe4\x93\x02\x42\"=/v16/customers/{customer_id=*}:generateKeywordForecastMetrics:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x87\x02\n%com.google.ads.googleads.v16.servicesB\x1bKeywordPlanIdeaServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.KeywordPlanAggregateMetrics", "google/ads/googleads/v16/common/keyword_plan_common.proto"], + ["google.ads.googleads.v16.common.DateRange", "google/ads/googleads/v16/common/dates.proto"], + ["google.ads.googleads.v16.common.KeywordInfo", "google/ads/googleads/v16/common/criteria.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + GenerateKeywordIdeasRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateKeywordIdeasRequest").msgclass + KeywordAndUrlSeed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.KeywordAndUrlSeed").msgclass + KeywordSeed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.KeywordSeed").msgclass + SiteSeed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SiteSeed").msgclass + UrlSeed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UrlSeed").msgclass + GenerateKeywordIdeaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateKeywordIdeaResponse").msgclass + GenerateKeywordIdeaResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateKeywordIdeaResult").msgclass + GenerateKeywordHistoricalMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateKeywordHistoricalMetricsRequest").msgclass + GenerateKeywordHistoricalMetricsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateKeywordHistoricalMetricsResponse").msgclass + GenerateKeywordHistoricalMetricsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateKeywordHistoricalMetricsResult").msgclass + GenerateAdGroupThemesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateAdGroupThemesRequest").msgclass + GenerateAdGroupThemesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateAdGroupThemesResponse").msgclass + AdGroupKeywordSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdGroupKeywordSuggestion").msgclass + UnusableAdGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UnusableAdGroup").msgclass + GenerateKeywordForecastMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateKeywordForecastMetricsRequest").msgclass + CampaignToForecast = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignToForecast").msgclass + CampaignToForecast::CampaignBiddingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignToForecast.CampaignBiddingStrategy").msgclass + ForecastAdGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ForecastAdGroup").msgclass + BiddableKeyword = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.BiddableKeyword").msgclass + CriterionBidModifier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CriterionBidModifier").msgclass + ManualCpcBiddingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ManualCpcBiddingStrategy").msgclass + MaximizeClicksBiddingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MaximizeClicksBiddingStrategy").msgclass + MaximizeConversionsBiddingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MaximizeConversionsBiddingStrategy").msgclass + GenerateKeywordForecastMetricsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateKeywordForecastMetricsResponse").msgclass + KeywordForecastMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.KeywordForecastMetrics").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service_services_pb.rb new file mode 100644 index 000000000..d82708f72 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_idea_service_services_pb.rb @@ -0,0 +1,94 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/keyword_plan_idea_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/keyword_plan_idea_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanIdeaService + # Proto file describing the keyword plan idea service. + # + # Service to generate keyword ideas. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.KeywordPlanIdeaService' + + # Returns a list of keyword ideas. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanIdeaError]() + # [QuotaError]() + # [RequestError]() + rpc :GenerateKeywordIdeas, ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeasRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordIdeaResponse + # Returns a list of keyword historical metrics. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :GenerateKeywordHistoricalMetrics, ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordHistoricalMetricsResponse + # Returns a list of suggested AdGroups and suggested modifications + # (text, match type) for the given keywords. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :GenerateAdGroupThemes, ::Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateAdGroupThemesResponse + # Returns metrics (such as impressions, clicks, total cost) of a keyword + # forecast for the given campaign. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :GenerateKeywordForecastMetrics, ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateKeywordForecastMetricsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_service.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_service.rb new file mode 100644 index 000000000..8672fa336 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/keyword_plan_service/credentials" +require "google/ads/google_ads/v16/services/keyword_plan_service/paths" +require "google/ads/google_ads/v16/services/keyword_plan_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage keyword plans. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/keyword_plan_service" + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client.new + # + module KeywordPlanService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "keyword_plan_service", "helpers.rb" +require "google/ads/google_ads/v16/services/keyword_plan_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_service/client.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_service/client.rb new file mode 100644 index 000000000..c9993e0ca --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_service/client.rb @@ -0,0 +1,450 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/keyword_plan_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanService + ## + # Client for the KeywordPlanService service. + # + # Service to manage keyword plans. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :keyword_plan_service_stub + + ## + # Configure the KeywordPlanService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KeywordPlanService clients + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KeywordPlanService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @keyword_plan_service_stub.universe_domain + end + + ## + # Create a new KeywordPlanService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KeywordPlanService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/keyword_plan_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @keyword_plan_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes keyword plans. Operation statuses are + # returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [KeywordPlanError]() + # [MutateError]() + # [NewResourceCreationError]() + # [QuotaError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [StringLengthError]() + # + # @overload mutate_keyword_plans(request, options = nil) + # Pass arguments to `mutate_keyword_plans` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlansRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlansRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_keyword_plans(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_keyword_plans` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose keyword plans are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::KeywordPlanOperation, ::Hash>] + # Required. The list of operations to perform on individual keyword plans. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlansResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlansResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateKeywordPlansRequest.new + # + # # Call the mutate_keyword_plans method. + # result = client.mutate_keyword_plans request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateKeywordPlansResponse. + # p result + # + def mutate_keyword_plans request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateKeywordPlansRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_keyword_plans.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_keyword_plans.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_keyword_plans.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @keyword_plan_service_stub.call_rpc :mutate_keyword_plans, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the KeywordPlanService API. + # + # This class represents the configuration for KeywordPlanService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_keyword_plans to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plans.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordPlanService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_keyword_plans.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the KeywordPlanService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_keyword_plans` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_keyword_plans + + # @private + def initialize parent_rpcs = nil + mutate_keyword_plans_config = parent_rpcs.mutate_keyword_plans if parent_rpcs.respond_to? :mutate_keyword_plans + @mutate_keyword_plans = ::Gapic::Config::Method.new mutate_keyword_plans_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_service/credentials.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_service/credentials.rb new file mode 100644 index 000000000..1874defe1 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanService + # Credentials for the KeywordPlanService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_service/paths.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_service/paths.rb new file mode 100644 index 000000000..5b8f2809d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordPlanService + # Path helper methods for the KeywordPlanService API. + module Paths + ## + # Create a fully-qualified KeywordPlan resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/keywordPlans/{keyword_plan_id}` + # + # @param customer_id [String] + # @param keyword_plan_id [String] + # + # @return [::String] + def keyword_plan_path customer_id:, keyword_plan_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/keywordPlans/#{keyword_plan_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_plan_service_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_plan_service_pb.rb new file mode 100644 index 000000000..a0095c805 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_plan_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/keyword_plan_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/keyword_plan_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the KeywordThemeConstantService API. + # + # This class represents the configuration for KeywordThemeConstantService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::KeywordThemeConstantService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # suggest_keyword_theme_constants to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::KeywordThemeConstantService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_keyword_theme_constants.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::KeywordThemeConstantService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_keyword_theme_constants.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the KeywordThemeConstantService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `suggest_keyword_theme_constants` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_keyword_theme_constants + + # @private + def initialize parent_rpcs = nil + suggest_keyword_theme_constants_config = parent_rpcs.suggest_keyword_theme_constants if parent_rpcs.respond_to? :suggest_keyword_theme_constants + @suggest_keyword_theme_constants = ::Gapic::Config::Method.new suggest_keyword_theme_constants_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service/credentials.rb b/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service/credentials.rb new file mode 100644 index 000000000..d6baf7eca --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordThemeConstantService + # Credentials for the KeywordThemeConstantService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service/paths.rb b/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service/paths.rb new file mode 100644 index 000000000..be6f8de73 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordThemeConstantService + # Path helper methods for the KeywordThemeConstantService API. + module Paths + ## + # Create a fully-qualified KeywordThemeConstant resource string. + # + # The resource will be in the following format: + # + # `keywordThemeConstants/{express_category_id}~{express_sub_category_id}` + # + # @param express_category_id [String] + # @param express_sub_category_id [String] + # + # @return [::String] + def keyword_theme_constant_path express_category_id:, express_sub_category_id: + raise ::ArgumentError, "express_category_id cannot contain /" if express_category_id.to_s.include? "/" + + "keywordThemeConstants/#{express_category_id}~#{express_sub_category_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service_pb.rb new file mode 100644 index 000000000..56cd66c3f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/keyword_theme_constant_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/keyword_theme_constant_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/services/keyword_theme_constant_service.proto\x12!google.ads.googleads.v16.services\x1a?google/ads/googleads/v16/resources/keyword_theme_constant.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\"f\n#SuggestKeywordThemeConstantsRequest\x12\x12\n\nquery_text\x18\x01 \x01(\t\x12\x14\n\x0c\x63ountry_code\x18\x02 \x01(\t\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x81\x01\n$SuggestKeywordThemeConstantsResponse\x12Y\n\x17keyword_theme_constants\x18\x01 \x03(\x0b\x32\x38.google.ads.googleads.v16.resources.KeywordThemeConstant2\xc5\x02\n\x1bKeywordThemeConstantService\x12\xde\x01\n\x1cSuggestKeywordThemeConstants\x12\x46.google.ads.googleads.v16.services.SuggestKeywordThemeConstantsRequest\x1aG.google.ads.googleads.v16.services.SuggestKeywordThemeConstantsResponse\"-\x82\xd3\xe4\x93\x02\'\"\"/v16/keywordThemeConstants:suggest:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8c\x02\n%com.google.ads.googleads.v16.servicesB KeywordThemeConstantServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.KeywordThemeConstant", "google/ads/googleads/v16/resources/keyword_theme_constant.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + SuggestKeywordThemeConstantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestKeywordThemeConstantsRequest").msgclass + SuggestKeywordThemeConstantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestKeywordThemeConstantsResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service_services_pb.rb new file mode 100644 index 000000000..f4495fa9e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/keyword_theme_constant_service_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/keyword_theme_constant_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/keyword_theme_constant_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module KeywordThemeConstantService + # Proto file describing the Smart Campaign keyword theme constant service. + # + # Service to fetch Smart Campaign keyword themes. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.KeywordThemeConstantService' + + # Returns KeywordThemeConstant suggestions by keyword themes. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :SuggestKeywordThemeConstants, ::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemeConstantsRequest, ::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemeConstantsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/label_service.rb b/lib/google/ads/google_ads/v16/services/label_service.rb new file mode 100644 index 000000000..a5cb15a4e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/label_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/label_service/credentials" +require "google/ads/google_ads/v16/services/label_service/paths" +require "google/ads/google_ads/v16/services/label_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage labels. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/label_service" + # client = ::Google::Ads::GoogleAds::V16::Services::LabelService::Client.new + # + module LabelService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "label_service", "helpers.rb" +require "google/ads/google_ads/v16/services/label_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/label_service/client.rb b/lib/google/ads/google_ads/v16/services/label_service/client.rb new file mode 100644 index 000000000..05f68780f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/label_service/client.rb @@ -0,0 +1,461 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/label_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module LabelService + ## + # Client for the LabelService service. + # + # Service to manage labels. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :label_service_stub + + ## + # Configure the LabelService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::LabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LabelService clients + # ::Google::Ads::GoogleAds::V16::Services::LabelService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LabelService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::LabelService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @label_service_stub.universe_domain + end + + ## + # Create a new LabelService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::LabelService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::LabelService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LabelService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/label_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @label_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::LabelService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes labels. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_labels(request, options = nil) + # Pass arguments to `mutate_labels` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateLabelsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateLabelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_labels(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_labels` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. ID of the customer whose labels are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::LabelOperation, ::Hash>] + # Required. The list of operations to perform on labels. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateLabelsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateLabelsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::LabelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateLabelsRequest.new + # + # # Call the mutate_labels method. + # result = client.mutate_labels request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateLabelsResponse. + # p result + # + def mutate_labels request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateLabelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_labels.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_labels.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_labels.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @label_service_stub.call_rpc :mutate_labels, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the LabelService API. + # + # This class represents the configuration for LabelService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::LabelService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_labels to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::LabelService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_labels.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::LabelService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_labels.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the LabelService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_labels` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_labels + + # @private + def initialize parent_rpcs = nil + mutate_labels_config = parent_rpcs.mutate_labels if parent_rpcs.respond_to? :mutate_labels + @mutate_labels = ::Gapic::Config::Method.new mutate_labels_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/label_service/credentials.rb b/lib/google/ads/google_ads/v16/services/label_service/credentials.rb new file mode 100644 index 000000000..71884914c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/label_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module LabelService + # Credentials for the LabelService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/label_service/paths.rb b/lib/google/ads/google_ads/v16/services/label_service/paths.rb new file mode 100644 index 000000000..b0a973c9b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/label_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module LabelService + # Path helper methods for the LabelService API. + module Paths + ## + # Create a fully-qualified Label resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/labels/{label_id}` + # + # @param customer_id [String] + # @param label_id [String] + # + # @return [::String] + def label_path customer_id:, label_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/labels/#{label_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/label_service_pb.rb b/lib/google/ads/google_ads/v16/services/label_service_pb.rb new file mode 100644 index 000000000..89180a586 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/label_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/label_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/label_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n5google/ads/googleads/v16/services/label_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a.google/ads/googleads/v16/resources/label.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x97\x02\n\x13MutateLabelsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\noperations\x18\x02 \x03(\x0b\x32\x31.google.ads.googleads.v16.services.LabelOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xff\x01\n\x0eLabelOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12;\n\x06\x63reate\x18\x01 \x01(\x0b\x32).google.ads.googleads.v16.resources.LabelH\x00\x12;\n\x06update\x18\x02 \x01(\x0b\x32).google.ads.googleads.v16.resources.LabelH\x00\x12\x35\n\x06remove\x18\x03 \x01(\tB#\xfa\x41 \n\x1egoogleads.googleapis.com/LabelH\x00\x42\x0b\n\toperation\"\x90\x01\n\x14MutateLabelsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\x07results\x18\x02 \x03(\x0b\x32\x34.google.ads.googleads.v16.services.MutateLabelResult\"\x89\x01\n\x11MutateLabelResult\x12:\n\rresource_name\x18\x01 \x01(\tB#\xfa\x41 \n\x1egoogleads.googleapis.com/Label\x12\x38\n\x05label\x18\x02 \x01(\x0b\x32).google.ads.googleads.v16.resources.Label2\xa9\x02\n\x0cLabelService\x12\xd1\x01\n\x0cMutateLabels\x12\x36.google.ads.googleads.v16.services.MutateLabelsRequest\x1a\x37.google.ads.googleads.v16.services.MutateLabelsResponse\"P\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x31\",/v16/customers/{customer_id=*}/labels:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\xfd\x01\n%com.google.ads.googleads.v16.servicesB\x11LabelServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.Label", "google/ads/googleads/v16/resources/label.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateLabelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateLabelsRequest").msgclass + LabelOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.LabelOperation").msgclass + MutateLabelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateLabelsResponse").msgclass + MutateLabelResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateLabelResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/label_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/label_service_services_pb.rb new file mode 100644 index 000000000..2b7b43ebf --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/label_service_services_pb.rb @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/label_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/label_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module LabelService + # Service to manage labels. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.LabelService' + + # Creates, updates, or removes labels. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [LabelError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateLabels, ::Google::Ads::GoogleAds::V16::Services::MutateLabelsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateLabelsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/offline_user_data_job_service.rb b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service.rb new file mode 100644 index 000000000..3864ac254 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/offline_user_data_job_service/credentials" +require "google/ads/google_ads/v16/services/offline_user_data_job_service/paths" +require "google/ads/google_ads/v16/services/offline_user_data_job_service/operations" +require "google/ads/google_ads/v16/services/offline_user_data_job_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage offline user data jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/offline_user_data_job_service" + # client = ::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.new + # + module OfflineUserDataJobService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "offline_user_data_job_service", "helpers.rb" +require "google/ads/google_ads/v16/services/offline_user_data_job_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/client.rb b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/client.rb new file mode 100644 index 000000000..d1666068b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/client.rb @@ -0,0 +1,694 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/offline_user_data_job_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module OfflineUserDataJobService + ## + # Client for the OfflineUserDataJobService service. + # + # Service to manage offline user data jobs. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :offline_user_data_job_service_stub + + ## + # Configure the OfflineUserDataJobService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all OfflineUserDataJobService clients + # ::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the OfflineUserDataJobService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @offline_user_data_job_service_stub.universe_domain + end + + ## + # Create a new OfflineUserDataJobService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the OfflineUserDataJobService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/offline_user_data_job_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @offline_user_data_job_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Operations] + # + attr_reader :operations_client + + # Service calls + + ## + # Creates an offline user data job. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [NotAllowlistedError]() + # [OfflineUserDataJobError]() + # [QuotaError]() + # [RequestError]() + # + # @overload create_offline_user_data_job(request, options = nil) + # Pass arguments to `create_offline_user_data_job` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_offline_user_data_job(customer_id: nil, job: nil, validate_only: nil, enable_match_rate_range_preview: nil) + # Pass arguments to `create_offline_user_data_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer for which to create an offline user data + # job. + # @param job [::Google::Ads::GoogleAds::V16::Resources::OfflineUserDataJob, ::Hash] + # Required. The offline user data job to be created. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param enable_match_rate_range_preview [::Boolean] + # If true, match rate range for the offline user data job is calculated and + # made available in the resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobRequest.new + # + # # Call the create_offline_user_data_job method. + # result = client.create_offline_user_data_job request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobResponse. + # p result + # + def create_offline_user_data_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_offline_user_data_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_offline_user_data_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_offline_user_data_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @offline_user_data_job_service_stub.call_rpc :create_offline_user_data_job, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Adds operations to the offline user data job. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [OfflineUserDataJobError]() + # [QuotaError]() + # [RequestError]() + # + # @overload add_offline_user_data_job_operations(request, options = nil) + # Pass arguments to `add_offline_user_data_job_operations` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_offline_user_data_job_operations(resource_name: nil, enable_partial_failure: nil, enable_warnings: nil, operations: nil, validate_only: nil) + # Pass arguments to `add_offline_user_data_job_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The resource name of the OfflineUserDataJob. + # @param enable_partial_failure [::Boolean] + # True to enable partial failure for the offline user data job. + # @param enable_warnings [::Boolean] + # True to enable warnings for the offline user data job. When enabled, a + # warning will not block the OfflineUserDataJobOperation, and will also + # return warning messages about malformed field values. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobOperation, ::Hash>] + # Required. The list of operations to be done. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsRequest.new + # + # # Call the add_offline_user_data_job_operations method. + # result = client.add_offline_user_data_job_operations request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsResponse. + # p result + # + def add_offline_user_data_job_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_offline_user_data_job_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_offline_user_data_job_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_offline_user_data_job_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @offline_user_data_job_service_stub.call_rpc :add_offline_user_data_job_operations, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Runs the offline user data job. + # + # When finished, the long running operation will contain the processing + # result or failure information, if any. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [HeaderError]() + # [InternalError]() + # [OfflineUserDataJobError]() + # [QuotaError]() + # [RequestError]() + # + # @overload run_offline_user_data_job(request, options = nil) + # Pass arguments to `run_offline_user_data_job` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::RunOfflineUserDataJobRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::RunOfflineUserDataJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_offline_user_data_job(resource_name: nil, validate_only: nil) + # Pass arguments to `run_offline_user_data_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The resource name of the OfflineUserDataJob to run. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::RunOfflineUserDataJobRequest.new + # + # # Call the run_offline_user_data_job method. + # result = client.run_offline_user_data_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def run_offline_user_data_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::RunOfflineUserDataJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.run_offline_user_data_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_offline_user_data_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_offline_user_data_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @offline_user_data_job_service_stub.call_rpc :run_offline_user_data_job, request, + options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the OfflineUserDataJobService API. + # + # This class represents the configuration for OfflineUserDataJobService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_offline_user_data_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_offline_user_data_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::OfflineUserDataJobService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_offline_user_data_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the OfflineUserDataJobService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_offline_user_data_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_offline_user_data_job + ## + # RPC-specific configuration for `add_offline_user_data_job_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :add_offline_user_data_job_operations + ## + # RPC-specific configuration for `run_offline_user_data_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_offline_user_data_job + + # @private + def initialize parent_rpcs = nil + create_offline_user_data_job_config = parent_rpcs.create_offline_user_data_job if parent_rpcs.respond_to? :create_offline_user_data_job + @create_offline_user_data_job = ::Gapic::Config::Method.new create_offline_user_data_job_config + add_offline_user_data_job_operations_config = parent_rpcs.add_offline_user_data_job_operations if parent_rpcs.respond_to? :add_offline_user_data_job_operations + @add_offline_user_data_job_operations = ::Gapic::Config::Method.new add_offline_user_data_job_operations_config + run_offline_user_data_job_config = parent_rpcs.run_offline_user_data_job if parent_rpcs.respond_to? :run_offline_user_data_job + @run_offline_user_data_job = ::Gapic::Config::Method.new run_offline_user_data_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/credentials.rb b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/credentials.rb new file mode 100644 index 000000000..a84bf66dc --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module OfflineUserDataJobService + # Credentials for the OfflineUserDataJobService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/operations.rb b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/operations.rb new file mode 100644 index 000000000..5c7462424 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/operations.rb @@ -0,0 +1,813 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module OfflineUserDataJobService + # Service that implements Longrunning Operations API. + class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the OfflineUserDataJobService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the OfflineUserDataJobService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, + operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/paths.rb b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/paths.rb new file mode 100644 index 000000000..8f638b03f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module OfflineUserDataJobService + # Path helper methods for the OfflineUserDataJobService API. + module Paths + ## + # Create a fully-qualified OfflineUserDataJob resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/offlineUserDataJobs/{offline_user_data_update_id}` + # + # @param customer_id [String] + # @param offline_user_data_update_id [String] + # + # @return [::String] + def offline_user_data_job_path customer_id:, offline_user_data_update_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/offlineUserDataJobs/#{offline_user_data_update_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/offline_user_data_job_service_pb.rb b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service_pb.rb new file mode 100644 index 000000000..aec969c60 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/offline_user_data_job_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/offline_user_data_pb' +require 'google/ads/google_ads/v16/resources/offline_user_data_job_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nEgoogle/ads/googleads/v16/services/offline_user_data_job_service.proto\x12!google.ads.googleads.v16.services\x1a\x37google/ads/googleads/v16/common/offline_user_data.proto\x1a>google/ads/googleads/v16/resources/offline_user_data_job.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\"\xc5\x01\n\x1f\x43reateOfflineUserDataJobRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12H\n\x03job\x18\x02 \x01(\x0b\x32\x36.google.ads.googleads.v16.resources.OfflineUserDataJobB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\'\n\x1f\x65nable_match_rate_range_preview\x18\x05 \x01(\x08\"k\n CreateOfflineUserDataJobResponse\x12G\n\rresource_name\x18\x01 \x01(\tB0\xfa\x41-\n+googleads.googleapis.com/OfflineUserDataJob\"\x81\x01\n\x1cRunOfflineUserDataJobRequest\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+googleads.googleapis.com/OfflineUserDataJob\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\"\xd6\x02\n&AddOfflineUserDataJobOperationsRequest\x12J\n\rresource_name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+googleads.googleapis.com/OfflineUserDataJob\x12#\n\x16\x65nable_partial_failure\x18\x04 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x0f\x65nable_warnings\x18\x06 \x01(\x08H\x01\x88\x01\x01\x12W\n\noperations\x18\x03 \x03(\x0b\x32>.google.ads.googleads.v16.services.OfflineUserDataJobOperationB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x05 \x01(\x08\x42\x19\n\x17_enable_partial_failureB\x12\n\x10_enable_warnings\"\xba\x01\n\x1bOfflineUserDataJobOperation\x12;\n\x06\x63reate\x18\x01 \x01(\x0b\x32).google.ads.googleads.v16.common.UserDataH\x00\x12;\n\x06remove\x18\x02 \x01(\x0b\x32).google.ads.googleads.v16.common.UserDataH\x00\x12\x14\n\nremove_all\x18\x03 \x01(\x08H\x00\x42\x0b\n\toperation\"\x81\x01\n\'AddOfflineUserDataJobOperationsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12#\n\x07warning\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status2\xb2\x07\n\x19OfflineUserDataJobService\x12\xfb\x01\n\x18\x43reateOfflineUserDataJob\x12\x42.google.ads.googleads.v16.services.CreateOfflineUserDataJobRequest\x1a\x43.google.ads.googleads.v16.services.CreateOfflineUserDataJobResponse\"V\xda\x41\x0f\x63ustomer_id,job\x82\xd3\xe4\x93\x02>\"9/v16/customers/{customer_id=*}/offlineUserDataJobs:create:\x01*\x12\xa4\x02\n\x1f\x41\x64\x64OfflineUserDataJobOperations\x12I.google.ads.googleads.v16.services.AddOfflineUserDataJobOperationsRequest\x1aJ.google.ads.googleads.v16.services.AddOfflineUserDataJobOperationsResponse\"j\xda\x41\x18resource_name,operations\x82\xd3\xe4\x93\x02I\"D/v16/{resource_name=customers/*/offlineUserDataJobs/*}:addOperations:\x01*\x12\xa8\x02\n\x15RunOfflineUserDataJob\x12?.google.ads.googleads.v16.services.RunOfflineUserDataJobRequest\x1a\x1d.google.longrunning.Operation\"\xae\x01\xca\x41V\n\x15google.protobuf.Empty\x12=google.ads.googleads.v16.resources.OfflineUserDataJobMetadata\xda\x41\rresource_name\x82\xd3\xe4\x93\x02?\":/v16/{resource_name=customers/*/offlineUserDataJobs/*}:run:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8a\x02\n%com.google.ads.googleads.v16.servicesB\x1eOfflineUserDataJobServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.OfflineUserDataJob", "google/ads/googleads/v16/resources/offline_user_data_job.proto"], + ["google.ads.googleads.v16.common.UserData", "google/ads/googleads/v16/common/offline_user_data.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + CreateOfflineUserDataJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CreateOfflineUserDataJobRequest").msgclass + CreateOfflineUserDataJobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CreateOfflineUserDataJobResponse").msgclass + RunOfflineUserDataJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.RunOfflineUserDataJobRequest").msgclass + AddOfflineUserDataJobOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AddOfflineUserDataJobOperationsRequest").msgclass + OfflineUserDataJobOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.OfflineUserDataJobOperation").msgclass + AddOfflineUserDataJobOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AddOfflineUserDataJobOperationsResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/offline_user_data_job_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service_services_pb.rb new file mode 100644 index 000000000..451612c37 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/offline_user_data_job_service_services_pb.rb @@ -0,0 +1,90 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/offline_user_data_job_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/offline_user_data_job_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module OfflineUserDataJobService + # Proto file describing the OfflineUserDataJobService. + # + # Service to manage offline user data jobs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.OfflineUserDataJobService' + + # Creates an offline user data job. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [NotAllowlistedError]() + # [OfflineUserDataJobError]() + # [QuotaError]() + # [RequestError]() + rpc :CreateOfflineUserDataJob, ::Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobRequest, ::Google::Ads::GoogleAds::V16::Services::CreateOfflineUserDataJobResponse + # Adds operations to the offline user data job. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [OfflineUserDataJobError]() + # [QuotaError]() + # [RequestError]() + rpc :AddOfflineUserDataJobOperations, ::Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsRequest, ::Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsResponse + # Runs the offline user data job. + # + # When finished, the long running operation will contain the processing + # result or failure information, if any. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [HeaderError]() + # [InternalError]() + # [OfflineUserDataJobError]() + # [QuotaError]() + # [RequestError]() + rpc :RunOfflineUserDataJob, ::Google::Ads::GoogleAds::V16::Services::RunOfflineUserDataJobRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/payments_account_service.rb b/lib/google/ads/google_ads/v16/services/payments_account_service.rb new file mode 100644 index 000000000..2c6bac9f0 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/payments_account_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/payments_account_service/credentials" +require "google/ads/google_ads/v16/services/payments_account_service/paths" +require "google/ads/google_ads/v16/services/payments_account_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to provide payments accounts that can be used to set up consolidated + # billing. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/payments_account_service" + # client = ::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client.new + # + module PaymentsAccountService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "payments_account_service", "helpers.rb" +require "google/ads/google_ads/v16/services/payments_account_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/payments_account_service/client.rb b/lib/google/ads/google_ads/v16/services/payments_account_service/client.rb new file mode 100644 index 000000000..7f18a65e6 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/payments_account_service/client.rb @@ -0,0 +1,437 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/payments_account_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module PaymentsAccountService + ## + # Client for the PaymentsAccountService service. + # + # Service to provide payments accounts that can be used to set up consolidated + # billing. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :payments_account_service_stub + + ## + # Configure the PaymentsAccountService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PaymentsAccountService clients + # ::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PaymentsAccountService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @payments_account_service_stub.universe_domain + end + + ## + # Create a new PaymentsAccountService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PaymentsAccountService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/payments_account_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @payments_account_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns all payments accounts associated with all managers + # between the login customer ID and specified serving customer in the + # hierarchy, inclusive. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [PaymentsAccountError]() + # [QuotaError]() + # [RequestError]() + # + # @overload list_payments_accounts(request, options = nil) + # Pass arguments to `list_payments_accounts` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_payments_accounts(customer_id: nil) + # Pass arguments to `list_payments_accounts` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer to apply the PaymentsAccount list + # operation to. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsRequest.new + # + # # Call the list_payments_accounts method. + # result = client.list_payments_accounts request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsResponse. + # p result + # + def list_payments_accounts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_payments_accounts.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_payments_accounts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_payments_accounts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @payments_account_service_stub.call_rpc :list_payments_accounts, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the PaymentsAccountService API. + # + # This class represents the configuration for PaymentsAccountService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_payments_accounts to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_payments_accounts.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::PaymentsAccountService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_payments_accounts.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the PaymentsAccountService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_payments_accounts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_payments_accounts + + # @private + def initialize parent_rpcs = nil + list_payments_accounts_config = parent_rpcs.list_payments_accounts if parent_rpcs.respond_to? :list_payments_accounts + @list_payments_accounts = ::Gapic::Config::Method.new list_payments_accounts_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/payments_account_service/credentials.rb b/lib/google/ads/google_ads/v16/services/payments_account_service/credentials.rb new file mode 100644 index 000000000..3a4bb2c62 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/payments_account_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module PaymentsAccountService + # Credentials for the PaymentsAccountService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/payments_account_service/paths.rb b/lib/google/ads/google_ads/v16/services/payments_account_service/paths.rb new file mode 100644 index 000000000..1044a5a7b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/payments_account_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module PaymentsAccountService + # Path helper methods for the PaymentsAccountService API. + module Paths + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified PaymentsAccount resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/paymentsAccounts/{payments_account_id}` + # + # @param customer_id [String] + # @param payments_account_id [String] + # + # @return [::String] + def payments_account_path customer_id:, payments_account_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/paymentsAccounts/#{payments_account_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/payments_account_service_pb.rb b/lib/google/ads/google_ads/v16/services/payments_account_service_pb.rb new file mode 100644 index 000000000..2d7f237f8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/payments_account_service_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/payments_account_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/payments_account_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n@google/ads/googleads/v16/services/payments_account_service.proto\x12!google.ads.googleads.v16.services\x1a\x39google/ads/googleads/v16/resources/payments_account.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"7\n\x1bListPaymentsAccountsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"n\n\x1cListPaymentsAccountsResponse\x12N\n\x11payments_accounts\x18\x01 \x03(\x0b\x32\x33.google.ads.googleads.v16.resources.PaymentsAccount2\xc0\x02\n\x16PaymentsAccountService\x12\xde\x01\n\x14ListPaymentsAccounts\x12>.google.ads.googleads.v16.services.ListPaymentsAccountsRequest\x1a?.google.ads.googleads.v16.services.ListPaymentsAccountsResponse\"E\xda\x41\x0b\x63ustomer_id\x82\xd3\xe4\x93\x02\x31\x12//v16/customers/{customer_id=*}/paymentsAccounts\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x87\x02\n%com.google.ads.googleads.v16.servicesB\x1bPaymentsAccountServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.PaymentsAccount", "google/ads/googleads/v16/resources/payments_account.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + ListPaymentsAccountsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListPaymentsAccountsRequest").msgclass + ListPaymentsAccountsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListPaymentsAccountsResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/payments_account_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/payments_account_service_services_pb.rb new file mode 100644 index 000000000..c3f5b01ac --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/payments_account_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/payments_account_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/payments_account_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module PaymentsAccountService + # Proto file describing the payments account service. + # + # Service to provide payments accounts that can be used to set up consolidated + # billing. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.PaymentsAccountService' + + # Returns all payments accounts associated with all managers + # between the login customer ID and specified serving customer in the + # hierarchy, inclusive. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [PaymentsAccountError]() + # [QuotaError]() + # [RequestError]() + rpc :ListPaymentsAccounts, ::Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsRequest, ::Google::Ads::GoogleAds::V16::Services::ListPaymentsAccountsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/product_link_invitation_service.rb b/lib/google/ads/google_ads/v16/services/product_link_invitation_service.rb new file mode 100644 index 000000000..b77053d7d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/product_link_invitation_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/product_link_invitation_service/credentials" +require "google/ads/google_ads/v16/services/product_link_invitation_service/paths" +require "google/ads/google_ads/v16/services/product_link_invitation_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # This service allows management of product link invitations from Google Ads + # accounts to other accounts. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/product_link_invitation_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.new + # + module ProductLinkInvitationService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "product_link_invitation_service", "helpers.rb" +require "google/ads/google_ads/v16/services/product_link_invitation_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/product_link_invitation_service/client.rb b/lib/google/ads/google_ads/v16/services/product_link_invitation_service/client.rb new file mode 100644 index 000000000..b720cfaef --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/product_link_invitation_service/client.rb @@ -0,0 +1,624 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/product_link_invitation_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ProductLinkInvitationService + ## + # Client for the ProductLinkInvitationService service. + # + # This service allows management of product link invitations from Google Ads + # accounts to other accounts. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :product_link_invitation_service_stub + + ## + # Configure the ProductLinkInvitationService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProductLinkInvitationService clients + # ::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProductLinkInvitationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @product_link_invitation_service_stub.universe_domain + end + + ## + # Create a new ProductLinkInvitationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProductLinkInvitationService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/product_link_invitation_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @product_link_invitation_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates a product link invitation. + # + # @overload create_product_link_invitation(request, options = nil) + # Pass arguments to `create_product_link_invitation` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::CreateProductLinkInvitationRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::CreateProductLinkInvitationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_product_link_invitation(customer_id: nil, product_link_invitation: nil) + # Pass arguments to `create_product_link_invitation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer being modified. + # @param product_link_invitation [::Google::Ads::GoogleAds::V16::Resources::ProductLinkInvitation, ::Hash] + # Required. The product link invitation to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::CreateProductLinkInvitationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::CreateProductLinkInvitationResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::CreateProductLinkInvitationRequest.new + # + # # Call the create_product_link_invitation method. + # result = client.create_product_link_invitation request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::CreateProductLinkInvitationResponse. + # p result + # + def create_product_link_invitation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::CreateProductLinkInvitationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_product_link_invitation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_product_link_invitation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_product_link_invitation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_link_invitation_service_stub.call_rpc :create_product_link_invitation, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Update a product link invitation. + # + # @overload update_product_link_invitation(request, options = nil) + # Pass arguments to `update_product_link_invitation` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::UpdateProductLinkInvitationRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::UpdateProductLinkInvitationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_product_link_invitation(customer_id: nil, product_link_invitation_status: nil, resource_name: nil) + # Pass arguments to `update_product_link_invitation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer being modified. + # @param product_link_invitation_status [::Google::Ads::GoogleAds::V16::Enums::ProductLinkInvitationStatusEnum::ProductLinkInvitationStatus] + # Required. The product link invitation to be created. + # @param resource_name [::String] + # Required. Resource name of the product link invitation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::UpdateProductLinkInvitationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::UpdateProductLinkInvitationResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::UpdateProductLinkInvitationRequest.new + # + # # Call the update_product_link_invitation method. + # result = client.update_product_link_invitation request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::UpdateProductLinkInvitationResponse. + # p result + # + def update_product_link_invitation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::UpdateProductLinkInvitationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_product_link_invitation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_product_link_invitation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_product_link_invitation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_link_invitation_service_stub.call_rpc :update_product_link_invitation, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Remove a product link invitation. + # + # @overload remove_product_link_invitation(request, options = nil) + # Pass arguments to `remove_product_link_invitation` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkInvitationRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkInvitationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_product_link_invitation(customer_id: nil, resource_name: nil) + # Pass arguments to `remove_product_link_invitation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the product link invitation being removed. + # @param resource_name [::String] + # Required. The resource name of the product link invitation being removed. + # expected, in this format: + # + # ` ` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkInvitationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkInvitationResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::RemoveProductLinkInvitationRequest.new + # + # # Call the remove_product_link_invitation method. + # result = client.remove_product_link_invitation request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::RemoveProductLinkInvitationResponse. + # p result + # + def remove_product_link_invitation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkInvitationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.remove_product_link_invitation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.remove_product_link_invitation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_product_link_invitation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_link_invitation_service_stub.call_rpc :remove_product_link_invitation, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ProductLinkInvitationService API. + # + # This class represents the configuration for ProductLinkInvitationService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_product_link_invitation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_link_invitation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ProductLinkInvitationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_link_invitation.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ProductLinkInvitationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_product_link_invitation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product_link_invitation + ## + # RPC-specific configuration for `update_product_link_invitation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product_link_invitation + ## + # RPC-specific configuration for `remove_product_link_invitation` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_product_link_invitation + + # @private + def initialize parent_rpcs = nil + create_product_link_invitation_config = parent_rpcs.create_product_link_invitation if parent_rpcs.respond_to? :create_product_link_invitation + @create_product_link_invitation = ::Gapic::Config::Method.new create_product_link_invitation_config + update_product_link_invitation_config = parent_rpcs.update_product_link_invitation if parent_rpcs.respond_to? :update_product_link_invitation + @update_product_link_invitation = ::Gapic::Config::Method.new update_product_link_invitation_config + remove_product_link_invitation_config = parent_rpcs.remove_product_link_invitation if parent_rpcs.respond_to? :remove_product_link_invitation + @remove_product_link_invitation = ::Gapic::Config::Method.new remove_product_link_invitation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/product_link_invitation_service/credentials.rb b/lib/google/ads/google_ads/v16/services/product_link_invitation_service/credentials.rb new file mode 100644 index 000000000..460ba0a95 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/product_link_invitation_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ProductLinkInvitationService + # Credentials for the ProductLinkInvitationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/product_link_invitation_service/paths.rb b/lib/google/ads/google_ads/v16/services/product_link_invitation_service/paths.rb new file mode 100644 index 000000000..bad453fcf --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/product_link_invitation_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ProductLinkInvitationService + # Path helper methods for the ProductLinkInvitationService API. + module Paths + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified ProductLinkInvitation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/productLinkInvitations/{customer_invitation_id}` + # + # @param customer_id [String] + # @param customer_invitation_id [String] + # + # @return [::String] + def product_link_invitation_path customer_id:, customer_invitation_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/productLinkInvitations/#{customer_invitation_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/product_link_invitation_service_pb.rb b/lib/google/ads/google_ads/v16/services/product_link_invitation_service_pb.rb new file mode 100644 index 000000000..d21874458 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/product_link_invitation_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/product_link_invitation_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/product_link_invitation_status_pb' +require 'google/ads/google_ads/v16/resources/product_link_invitation_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/services/product_link_invitation_service.proto\x12!google.ads.googleads.v16.services\x1a\x43google/ads/googleads/v16/enums/product_link_invitation_status.proto\x1a@google/ads/googleads/v16/resources/product_link_invitation.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9f\x01\n\"CreateProductLinkInvitationRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12_\n\x17product_link_invitation\x18\x02 \x01(\x0b\x32\x39.google.ads.googleads.v16.resources.ProductLinkInvitationB\x03\xe0\x41\x02\"q\n#CreateProductLinkInvitationResponse\x12J\n\rresource_name\x18\x01 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/ProductLinkInvitation\"\x98\x02\n\"UpdateProductLinkInvitationRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x88\x01\n\x1eproduct_link_invitation_status\x18\x02 \x01(\x0e\x32[.google.ads.googleads.v16.enums.ProductLinkInvitationStatusEnum.ProductLinkInvitationStatusB\x03\xe0\x41\x02\x12M\n\rresource_name\x18\x03 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.googleads.googleapis.com/ProductLinkInvitation\"q\n#UpdateProductLinkInvitationResponse\x12J\n\rresource_name\x18\x01 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/ProductLinkInvitation\"\x8d\x01\n\"RemoveProductLinkInvitationRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12M\n\rresource_name\x18\x02 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.googleads.googleapis.com/ProductLinkInvitation\"q\n#RemoveProductLinkInvitationResponse\x12J\n\rresource_name\x18\x01 \x01(\tB3\xfa\x41\x30\n.googleads.googleapis.com/ProductLinkInvitation2\xcb\x07\n\x1cProductLinkInvitationService\x12\x9b\x02\n\x1b\x43reateProductLinkInvitation\x12\x45.google.ads.googleads.v16.services.CreateProductLinkInvitationRequest\x1a\x46.google.ads.googleads.v16.services.CreateProductLinkInvitationResponse\"m\xda\x41#customer_id,product_link_invitation\x82\xd3\xe4\x93\x02\x41\" grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Removes a product link. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RequestError]() + # + # @overload remove_product_link(request, options = nil) + # Pass arguments to `remove_product_link` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_product_link(customer_id: nil, resource_name: nil, validate_only: nil) + # Pass arguments to `remove_product_link` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer being modified. + # @param resource_name [::String] + # Required. Remove operation: A resource name for the product link to remove + # is expected, in this format: + # + # `customers/{customer_id}/productLinks/{product_link_id} ` + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ProductLinkService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::RemoveProductLinkRequest.new + # + # # Call the remove_product_link method. + # result = client.remove_product_link request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::RemoveProductLinkResponse. + # p result + # + def remove_product_link request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::RemoveProductLinkRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.remove_product_link.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.remove_product_link.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_product_link.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_link_service_stub.call_rpc :remove_product_link, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ProductLinkService API. + # + # This class represents the configuration for ProductLinkService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ProductLinkService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_product_link to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ProductLinkService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_link.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ProductLinkService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_link.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ProductLinkService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_product_link` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product_link + ## + # RPC-specific configuration for `remove_product_link` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_product_link + + # @private + def initialize parent_rpcs = nil + create_product_link_config = parent_rpcs.create_product_link if parent_rpcs.respond_to? :create_product_link + @create_product_link = ::Gapic::Config::Method.new create_product_link_config + remove_product_link_config = parent_rpcs.remove_product_link if parent_rpcs.respond_to? :remove_product_link + @remove_product_link = ::Gapic::Config::Method.new remove_product_link_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/product_link_service/credentials.rb b/lib/google/ads/google_ads/v16/services/product_link_service/credentials.rb new file mode 100644 index 000000000..03ea31653 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/product_link_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ProductLinkService + # Credentials for the ProductLinkService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/product_link_service/paths.rb b/lib/google/ads/google_ads/v16/services/product_link_service/paths.rb new file mode 100644 index 000000000..a40d6e364 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/product_link_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ProductLinkService + # Path helper methods for the ProductLinkService API. + module Paths + ## + # Create a fully-qualified Customer resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}` + # + # @param customer_id [String] + # + # @return [::String] + def customer_path customer_id: + "customers/#{customer_id}" + end + + ## + # Create a fully-qualified ProductLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/productLinks/{product_link_id}` + # + # @param customer_id [String] + # @param product_link_id [String] + # + # @return [::String] + def product_link_path customer_id:, product_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/productLinks/#{product_link_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/product_link_service_pb.rb b/lib/google/ads/google_ads/v16/services/product_link_service_pb.rb new file mode 100644 index 000000000..15f3b63fd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/product_link_service_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/product_link_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/product_link_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Returns the list of per-location plannable YouTube ad formats with allowed + # targeting. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload list_plannable_products(request, options = nil) + # Pass arguments to `list_plannable_products` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ListPlannableProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ListPlannableProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_plannable_products(plannable_location_id: nil) + # Pass arguments to `list_plannable_products` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param plannable_location_id [::String] + # Required. The ID of the selected location for planning. To list the + # available plannable location IDs use + # {::Google::Ads::GoogleAds::V16::Services::ReachPlanService::Client#list_plannable_locations ReachPlanService.ListPlannableLocations}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ListPlannableProductsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ListPlannableProductsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ReachPlanService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ListPlannableProductsRequest.new + # + # # Call the list_plannable_products method. + # result = client.list_plannable_products request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ListPlannableProductsResponse. + # p result + # + def list_plannable_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ListPlannableProductsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_plannable_products.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_plannable_products.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_plannable_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reach_plan_service_stub.call_rpc :list_plannable_products, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Generates a reach forecast for a given targeting / product mix. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [ReachPlanError]() + # [RequestError]() + # + # @overload generate_reach_forecast(request, options = nil) + # Pass arguments to `generate_reach_forecast` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateReachForecastRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateReachForecastRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_reach_forecast(customer_id: nil, currency_code: nil, campaign_duration: nil, cookie_frequency_cap: nil, cookie_frequency_cap_setting: nil, min_effective_frequency: nil, effective_frequency_limit: nil, targeting: nil, planned_products: nil, forecast_metric_options: nil, customer_reach_group: nil) + # Pass arguments to `generate_reach_forecast` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param currency_code [::String] + # The currency code. + # Three-character ISO 4217 currency code. + # @param campaign_duration [::Google::Ads::GoogleAds::V16::Services::CampaignDuration, ::Hash] + # Required. Campaign duration. + # @param cookie_frequency_cap [::Integer] + # Chosen cookie frequency cap to be applied to each planned product. + # This is equivalent to the frequency cap exposed in Google Ads when creating + # a campaign, it represents the maximum number of times an ad can be shown to + # the same user. + # If not specified, no cap is applied. + # + # This field is deprecated in v4 and will eventually be removed. + # Use cookie_frequency_cap_setting instead. + # @param cookie_frequency_cap_setting [::Google::Ads::GoogleAds::V16::Services::FrequencyCap, ::Hash] + # Chosen cookie frequency cap to be applied to each planned product. + # This is equivalent to the frequency cap exposed in Google Ads when creating + # a campaign, it represents the maximum number of times an ad can be shown to + # the same user during a specified time interval. + # If not specified, a default of 0 (no cap) is applied. + # + # This field replaces the deprecated cookie_frequency_cap field. + # @param min_effective_frequency [::Integer] + # Chosen minimum effective frequency (the number of times a person was + # exposed to the ad) for the reported reach metrics [1-10]. + # This won't affect the targeting, but just the reporting. + # If not specified, a default of 1 is applied. + # + # This field cannot be combined with the effective_frequency_limit field. + # @param effective_frequency_limit [::Google::Ads::GoogleAds::V16::Services::EffectiveFrequencyLimit, ::Hash] + # The highest minimum effective frequency (the number of times a person was + # exposed to the ad) value [1-10] to include in + # Forecast.effective_frequency_breakdowns. + # If not specified, Forecast.effective_frequency_breakdowns will not be + # provided. + # + # The effective frequency value provided here will also be used as the + # minimum effective frequency for the reported reach metrics. + # + # This field cannot be combined with the min_effective_frequency field. + # @param targeting [::Google::Ads::GoogleAds::V16::Services::Targeting, ::Hash] + # The targeting to be applied to all products selected in the product mix. + # + # This is planned targeting: execution details might vary based on the + # advertising product, consult an implementation specialist. + # + # See specific metrics for details on how targeting affects them. + # @param planned_products [::Array<::Google::Ads::GoogleAds::V16::Services::PlannedProduct, ::Hash>] + # Required. The products to be forecast. + # The max number of allowed planned products is 15. + # @param forecast_metric_options [::Google::Ads::GoogleAds::V16::Services::ForecastMetricOptions, ::Hash] + # Controls the forecast metrics returned in the response. + # @param customer_reach_group [::String] + # The name of the customer being planned for. This is a user-defined value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GenerateReachForecastResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GenerateReachForecastResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ReachPlanService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateReachForecastRequest.new + # + # # Call the generate_reach_forecast method. + # result = client.generate_reach_forecast request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GenerateReachForecastResponse. + # p result + # + def generate_reach_forecast request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateReachForecastRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_reach_forecast.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_reach_forecast.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_reach_forecast.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reach_plan_service_stub.call_rpc :generate_reach_forecast, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ReachPlanService API. + # + # This class represents the configuration for ReachPlanService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ReachPlanService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_plannable_locations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ReachPlanService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_plannable_locations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ReachPlanService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_plannable_locations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ReachPlanService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_plannable_locations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_plannable_locations + ## + # RPC-specific configuration for `list_plannable_products` + # @return [::Gapic::Config::Method] + # + attr_reader :list_plannable_products + ## + # RPC-specific configuration for `generate_reach_forecast` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_reach_forecast + + # @private + def initialize parent_rpcs = nil + list_plannable_locations_config = parent_rpcs.list_plannable_locations if parent_rpcs.respond_to? :list_plannable_locations + @list_plannable_locations = ::Gapic::Config::Method.new list_plannable_locations_config + list_plannable_products_config = parent_rpcs.list_plannable_products if parent_rpcs.respond_to? :list_plannable_products + @list_plannable_products = ::Gapic::Config::Method.new list_plannable_products_config + generate_reach_forecast_config = parent_rpcs.generate_reach_forecast if parent_rpcs.respond_to? :generate_reach_forecast + @generate_reach_forecast = ::Gapic::Config::Method.new generate_reach_forecast_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/reach_plan_service/credentials.rb b/lib/google/ads/google_ads/v16/services/reach_plan_service/credentials.rb new file mode 100644 index 000000000..775293898 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/reach_plan_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ReachPlanService + # Credentials for the ReachPlanService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/reach_plan_service_pb.rb b/lib/google/ads/google_ads/v16/services/reach_plan_service_pb.rb new file mode 100644 index 000000000..4071fa6a4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/reach_plan_service_pb.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/reach_plan_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/common/dates_pb' +require 'google/ads/google_ads/v16/enums/frequency_cap_time_unit_pb' +require 'google/ads/google_ads/v16/enums/reach_plan_age_range_pb' +require 'google/ads/google_ads/v16/enums/reach_plan_network_pb' +require 'google/ads/google_ads/v16/enums/reach_plan_surface_pb' +require 'google/ads/google_ads/v16/enums/target_frequency_time_unit_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/services/reach_plan_service.proto\x12!google.ads.googleads.v16.services\x1a.google/ads/googleads/v16/common/criteria.proto\x1a+google/ads/googleads/v16/common/dates.proto\x1a\n\ndate_range\x18\x03 \x01(\x0b\x32*.google.ads.googleads.v16.common.DateRangeB\x13\n\x11_duration_in_days\"\xe9\x01\n\x0ePlannedProduct\x12(\n\x16plannable_product_code\x18\x03 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1f\n\rbudget_micros\x18\x04 \x01(\x03\x42\x03\xe0\x41\x02H\x01\x88\x01\x01\x12_\n\x1a\x61\x64vanced_product_targeting\x18\x05 \x01(\x0b\x32;.google.ads.googleads.v16.services.AdvancedProductTargetingB\x19\n\x17_plannable_product_codeB\x10\n\x0e_budget_micros\"\xc3\x01\n\x1dGenerateReachForecastResponse\x12^\n\x1aon_target_audience_metrics\x18\x01 \x01(\x0b\x32:.google.ads.googleads.v16.services.OnTargetAudienceMetrics\x12\x42\n\x0breach_curve\x18\x02 \x01(\x0b\x32-.google.ads.googleads.v16.services.ReachCurve\"W\n\nReachCurve\x12I\n\x0freach_forecasts\x18\x01 \x03(\x0b\x32\x30.google.ads.googleads.v16.services.ReachForecast\"\xcc\x01\n\rReachForecast\x12\x13\n\x0b\x63ost_micros\x18\x05 \x01(\x03\x12=\n\x08\x66orecast\x18\x02 \x01(\x0b\x32+.google.ads.googleads.v16.services.Forecast\x12g\n\x1fplanned_product_reach_forecasts\x18\x04 \x03(\x0b\x32>.google.ads.googleads.v16.services.PlannedProductReachForecast\"\xa4\x05\n\x08\x46orecast\x12\x1c\n\x0fon_target_reach\x18\x05 \x01(\x03H\x00\x88\x01\x01\x12\x18\n\x0btotal_reach\x18\x06 \x01(\x03H\x01\x88\x01\x01\x12\"\n\x15on_target_impressions\x18\x07 \x01(\x03H\x02\x88\x01\x01\x12\x1e\n\x11total_impressions\x18\x08 \x01(\x03H\x03\x88\x01\x01\x12!\n\x14viewable_impressions\x18\t \x01(\x03H\x04\x88\x01\x01\x12\x66\n\x1e\x65\x66\x66\x65\x63tive_frequency_breakdowns\x18\n \x03(\x0b\x32>.google.ads.googleads.v16.services.EffectiveFrequencyBreakdown\x12#\n\x16on_target_coview_reach\x18\x0b \x01(\x03H\x05\x88\x01\x01\x12\x1f\n\x12total_coview_reach\x18\x0c \x01(\x03H\x06\x88\x01\x01\x12)\n\x1con_target_coview_impressions\x18\r \x01(\x03H\x07\x88\x01\x01\x12%\n\x18total_coview_impressions\x18\x0e \x01(\x03H\x08\x88\x01\x01\x12\x12\n\x05views\x18\x0f \x01(\x03H\t\x88\x01\x01\x42\x12\n\x10_on_target_reachB\x0e\n\x0c_total_reachB\x18\n\x16_on_target_impressionsB\x14\n\x12_total_impressionsB\x17\n\x15_viewable_impressionsB\x19\n\x17_on_target_coview_reachB\x15\n\x13_total_coview_reachB\x1f\n\x1d_on_target_coview_impressionsB\x1b\n\x19_total_coview_impressionsB\x08\n\x06_views\"\xaf\x01\n\x1bPlannedProductReachForecast\x12\x1e\n\x16plannable_product_code\x18\x01 \x01(\t\x12\x13\n\x0b\x63ost_micros\x18\x02 \x01(\x03\x12[\n\x18planned_product_forecast\x18\x03 \x01(\x0b\x32\x39.google.ads.googleads.v16.services.PlannedProductForecast\"\x98\x04\n\x16PlannedProductForecast\x12\x17\n\x0fon_target_reach\x18\x01 \x01(\x03\x12\x13\n\x0btotal_reach\x18\x02 \x01(\x03\x12\x1d\n\x15on_target_impressions\x18\x03 \x01(\x03\x12\x19\n\x11total_impressions\x18\x04 \x01(\x03\x12!\n\x14viewable_impressions\x18\x05 \x01(\x03H\x00\x88\x01\x01\x12#\n\x16on_target_coview_reach\x18\x06 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\x12total_coview_reach\x18\x07 \x01(\x03H\x02\x88\x01\x01\x12)\n\x1con_target_coview_impressions\x18\x08 \x01(\x03H\x03\x88\x01\x01\x12%\n\x18total_coview_impressions\x18\t \x01(\x03H\x04\x88\x01\x01\x12\x1e\n\x11\x61verage_frequency\x18\n \x01(\x01H\x05\x88\x01\x01\x12\x12\n\x05views\x18\x0b \x01(\x03H\x06\x88\x01\x01\x42\x17\n\x15_viewable_impressionsB\x19\n\x17_on_target_coview_reachB\x15\n\x13_total_coview_reachB\x1f\n\x1d_on_target_coview_impressionsB\x1b\n\x19_total_coview_impressionsB\x14\n\x12_average_frequencyB\x08\n\x06_views\"\x93\x01\n\x17OnTargetAudienceMetrics\x12\"\n\x15youtube_audience_size\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12!\n\x14\x63\x65nsus_audience_size\x18\x04 \x01(\x03H\x01\x88\x01\x01\x42\x18\n\x16_youtube_audience_sizeB\x17\n\x15_census_audience_size\"\xfc\x01\n\x1b\x45\x66\x66\x65\x63tiveFrequencyBreakdown\x12\x1b\n\x13\x65\x66\x66\x65\x63tive_frequency\x18\x01 \x01(\x05\x12\x17\n\x0fon_target_reach\x18\x02 \x01(\x03\x12\x13\n\x0btotal_reach\x18\x03 \x01(\x03\x12#\n\x16\x65\x66\x66\x65\x63tive_coview_reach\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12-\n on_target_effective_coview_reach\x18\x05 \x01(\x03H\x01\x88\x01\x01\x42\x19\n\x17_effective_coview_reachB#\n!_on_target_effective_coview_reach\"/\n\x15\x46orecastMetricOptions\x12\x16\n\x0einclude_coview\x18\x01 \x01(\x08\"]\n\x11\x41udienceTargeting\x12H\n\ruser_interest\x18\x01 \x03(\x0b\x32\x31.google.ads.googleads.v16.common.UserInterestInfo\"\xc5\x02\n\x18\x41\x64vancedProductTargeting\x12W\n\x1asurface_targeting_settings\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.services.SurfaceTargeting\x12]\n\x19target_frequency_settings\x18\x03 \x01(\x0b\x32:.google.ads.googleads.v16.services.TargetFrequencySettings\x12[\n\x17youtube_select_settings\x18\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.services.YouTubeSelectSettingsH\x00\x42\x14\n\x12\x61\x64vanced_targeting\"*\n\x15YouTubeSelectSettings\x12\x11\n\tlineup_id\x18\x01 \x01(\x03\"=\n\x13YouTubeSelectLineUp\x12\x11\n\tlineup_id\x18\x01 \x01(\x03\x12\x13\n\x0blineup_name\x18\x02 \x01(\t\"\xcd\x01\n\x1cSurfaceTargetingCombinations\x12N\n\x11\x64\x65\x66\x61ult_targeting\x18\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.services.SurfaceTargeting\x12]\n available_targeting_combinations\x18\x02 \x03(\x0b\x32\x33.google.ads.googleads.v16.services.SurfaceTargeting\"k\n\x10SurfaceTargeting\x12W\n\x08surfaces\x18\x01 \x03(\x0e\x32\x45.google.ads.googleads.v16.enums.ReachPlanSurfaceEnum.ReachPlanSurface\"\xa5\x01\n\x17TargetFrequencySettings\x12k\n\ttime_unit\x18\x01 \x01(\x0e\x32S.google.ads.googleads.v16.enums.TargetFrequencyTimeUnitEnum.TargetFrequencyTimeUnitB\x03\xe0\x41\x02\x12\x1d\n\x10target_frequency\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x32\x8c\x06\n\x10ReachPlanService\x12\xc5\x01\n\x16ListPlannableLocations\x12@.google.ads.googleads.v16.services.ListPlannableLocationsRequest\x1a\x41.google.ads.googleads.v16.services.ListPlannableLocationsResponse\"&\x82\xd3\xe4\x93\x02 \"\x1b/v16:listPlannableLocations:\x01*\x12\xd9\x01\n\x15ListPlannableProducts\x12?.google.ads.googleads.v16.services.ListPlannableProductsRequest\x1a@.google.ads.googleads.v16.services.ListPlannableProductsResponse\"=\xda\x41\x15plannable_location_id\x82\xd3\xe4\x93\x02\x1f\"\x1a/v16:listPlannableProducts:\x01*\x12\x8c\x02\n\x15GenerateReachForecast\x12?.google.ads.googleads.v16.services.GenerateReachForecastRequest\x1a@.google.ads.googleads.v16.services.GenerateReachForecastResponse\"p\xda\x41.customer_id,campaign_duration,planned_products\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}:generateReachForecast:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x81\x02\n%com.google.ads.googleads.v16.servicesB\x15ReachPlanServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.GenderInfo", "google/ads/googleads/v16/common/criteria.proto"], + ["google.ads.googleads.v16.common.DateRange", "google/ads/googleads/v16/common/dates.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + ListPlannableLocationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListPlannableLocationsRequest").msgclass + ListPlannableLocationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListPlannableLocationsResponse").msgclass + PlannableLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.PlannableLocation").msgclass + ListPlannableProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListPlannableProductsRequest").msgclass + ListPlannableProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ListPlannableProductsResponse").msgclass + ProductMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ProductMetadata").msgclass + PlannableTargeting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.PlannableTargeting").msgclass + GenerateReachForecastRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateReachForecastRequest").msgclass + EffectiveFrequencyLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.EffectiveFrequencyLimit").msgclass + FrequencyCap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.FrequencyCap").msgclass + Targeting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.Targeting").msgclass + CampaignDuration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.CampaignDuration").msgclass + PlannedProduct = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.PlannedProduct").msgclass + GenerateReachForecastResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateReachForecastResponse").msgclass + ReachCurve = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ReachCurve").msgclass + ReachForecast = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ReachForecast").msgclass + Forecast = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.Forecast").msgclass + PlannedProductReachForecast = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.PlannedProductReachForecast").msgclass + PlannedProductForecast = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.PlannedProductForecast").msgclass + OnTargetAudienceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.OnTargetAudienceMetrics").msgclass + EffectiveFrequencyBreakdown = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.EffectiveFrequencyBreakdown").msgclass + ForecastMetricOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ForecastMetricOptions").msgclass + AudienceTargeting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AudienceTargeting").msgclass + AdvancedProductTargeting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.AdvancedProductTargeting").msgclass + YouTubeSelectSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.YouTubeSelectSettings").msgclass + YouTubeSelectLineUp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.YouTubeSelectLineUp").msgclass + SurfaceTargetingCombinations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SurfaceTargetingCombinations").msgclass + SurfaceTargeting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SurfaceTargeting").msgclass + TargetFrequencySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.TargetFrequencySettings").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/reach_plan_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/reach_plan_service_services_pb.rb new file mode 100644 index 000000000..4ea62fc11 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/reach_plan_service_services_pb.rb @@ -0,0 +1,85 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/reach_plan_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/reach_plan_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ReachPlanService + # Proto file describing the reach plan service. + # + # Reach Plan Service gives users information about audience size that can + # be reached through advertisement on YouTube. In particular, + # GenerateReachForecast provides estimated number of people of specified + # demographics that can be reached by an ad in a given market by a campaign of + # certain duration with a defined budget. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ReachPlanService' + + # Returns the list of plannable locations (for example, countries). + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :ListPlannableLocations, ::Google::Ads::GoogleAds::V16::Services::ListPlannableLocationsRequest, ::Google::Ads::GoogleAds::V16::Services::ListPlannableLocationsResponse + # Returns the list of per-location plannable YouTube ad formats with allowed + # targeting. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :ListPlannableProducts, ::Google::Ads::GoogleAds::V16::Services::ListPlannableProductsRequest, ::Google::Ads::GoogleAds::V16::Services::ListPlannableProductsResponse + # Generates a reach forecast for a given targeting / product mix. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RangeError]() + # [ReachPlanError]() + # [RequestError]() + rpc :GenerateReachForecast, ::Google::Ads::GoogleAds::V16::Services::GenerateReachForecastRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateReachForecastResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_service.rb b/lib/google/ads/google_ads/v16/services/recommendation_service.rb new file mode 100644 index 000000000..362b931d3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/recommendation_service/credentials" +require "google/ads/google_ads/v16/services/recommendation_service/paths" +require "google/ads/google_ads/v16/services/recommendation_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage recommendations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/recommendation_service" + # client = ::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.new + # + module RecommendationService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "recommendation_service", "helpers.rb" +require "google/ads/google_ads/v16/services/recommendation_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/recommendation_service/client.rb b/lib/google/ads/google_ads/v16/services/recommendation_service/client.rb new file mode 100644 index 000000000..dc8d72e56 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_service/client.rb @@ -0,0 +1,704 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/recommendation_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RecommendationService + ## + # Client for the RecommendationService service. + # + # Service to manage recommendations. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recommendation_service_stub + + ## + # Configure the RecommendationService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RecommendationService clients + # ::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RecommendationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @recommendation_service_stub.universe_domain + end + + ## + # Create a new RecommendationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RecommendationService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/recommendation_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @recommendation_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::RecommendationService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Applies given recommendations with corresponding apply parameters. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RecommendationError]() + # [RequestError]() + # [UrlFieldError]() + # + # @overload apply_recommendation(request, options = nil) + # Pass arguments to `apply_recommendation` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::ApplyRecommendationRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::ApplyRecommendationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload apply_recommendation(customer_id: nil, operations: nil, partial_failure: nil) + # Pass arguments to `apply_recommendation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer with the recommendation. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::ApplyRecommendationOperation, ::Hash>] + # Required. The list of operations to apply recommendations. + # If partial_failure=false all recommendations should be of the same type + # There is a limit of 100 operations per request. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, operations will be carried + # out as a transaction if and only if they are all valid. + # Default is false. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::ApplyRecommendationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::ApplyRecommendationResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::ApplyRecommendationRequest.new + # + # # Call the apply_recommendation method. + # result = client.apply_recommendation request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::ApplyRecommendationResponse. + # p result + # + def apply_recommendation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::ApplyRecommendationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.apply_recommendation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.apply_recommendation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.apply_recommendation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommendation_service_stub.call_rpc :apply_recommendation, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Dismisses given recommendations. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RecommendationError]() + # [RequestError]() + # + # @overload dismiss_recommendation(request, options = nil) + # Pass arguments to `dismiss_recommendation` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::DismissRecommendationRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::DismissRecommendationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload dismiss_recommendation(customer_id: nil, operations: nil, partial_failure: nil) + # Pass arguments to `dismiss_recommendation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer with the recommendation. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::DismissRecommendationRequest::DismissRecommendationOperation, ::Hash>] + # Required. The list of operations to dismiss recommendations. + # If partial_failure=false all recommendations should be of the same type + # There is a limit of 100 operations per request. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, operations will be carried in a + # single transaction if and only if they are all valid. + # Default is false. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::DismissRecommendationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::DismissRecommendationResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::DismissRecommendationRequest.new + # + # # Call the dismiss_recommendation method. + # result = client.dismiss_recommendation request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::DismissRecommendationResponse. + # p result + # + def dismiss_recommendation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::DismissRecommendationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.dismiss_recommendation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.dismiss_recommendation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.dismiss_recommendation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommendation_service_stub.call_rpc :dismiss_recommendation, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Generates Recommendations based off the requested recommendation_types. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RecommendationError]() + # [RequestError]() + # + # @overload generate_recommendations(request, options = nil) + # Pass arguments to `generate_recommendations` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_recommendations(customer_id: nil, recommendation_types: nil, advertising_channel_type: nil, campaign_sitelink_count: nil, conversion_tracking_status: nil, bidding_info: nil, ad_group_info: nil, seed_info: nil) + # Pass arguments to `generate_recommendations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer generating recommendations. + # @param recommendation_types [::Array<::Google::Ads::GoogleAds::V16::Enums::RecommendationTypeEnum::RecommendationType>] + # Required. List of eligible recommendation_types to generate. If the + # uploaded criteria isn't sufficient to make a recommendation, or the + # campaign is already in the recommended state, no recommendation will be + # returned for that type. Generally, a recommendation is returned if all + # required fields for that recommendation_type are uploaded, but there are + # cases where this is still not sufficient. + # + # The following recommendation_types are supported for recommendation + # generation: + # KEYWORD, MAXIMIZE_CLICKS_OPT_IN, MAXIMIZE_CONVERSIONS_OPT_IN, + # MAXIMIZE_CONVERSION_VALUE_OPT_IN, SET_TARGET_CPA, SET_TARGET_ROAS, + # SITELINK_ASSET, TARGET_CPA_OPT_IN, TARGET_ROAS_OPT_IN + # @param advertising_channel_type [::Google::Ads::GoogleAds::V16::Enums::AdvertisingChannelTypeEnum::AdvertisingChannelType] + # Required. Advertising channel type of the campaign. + # The following advertising_channel_types are supported for recommendation + # generation: + # PERFORMANCE_MAX and SEARCH + # @param campaign_sitelink_count [::Integer] + # Optional. Number of sitelinks on the campaign. + # This field is necessary for the following recommendation_types: + # SITELINK_ASSET + # @param conversion_tracking_status [::Google::Ads::GoogleAds::V16::Enums::ConversionTrackingStatusEnum::ConversionTrackingStatus] + # Optional. Current conversion tracking status. + # This field is necessary for the following recommendation_types: + # MAXIMIZE_CLICKS_OPT_IN, MAXIMIZE_CONVERSIONS_OPT_IN, + # MAXIMIZE_CONVERSION_VALUE_OPT_IN, SET_TARGET_CPA, SET_TARGET_ROAS, + # TARGET_CPA_OPT_IN, TARGET_ROAS_OPT_IN + # @param bidding_info [::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsRequest::BiddingInfo, ::Hash] + # Optional. Current bidding information of the campaign. + # This field is necessary for the following recommendation_types: + # MAXIMIZE_CLICKS_OPT_IN, MAXIMIZE_CONVERSIONS_OPT_IN, + # MAXIMIZE_CONVERSION_VALUE_OPT_IN, SET_TARGET_CPA, SET_TARGET_ROAS, + # TARGET_CPA_OPT_IN, TARGET_ROAS_OPT_IN + # @param ad_group_info [::Array<::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsRequest::AdGroupInfo, ::Hash>] + # Optional. Current AdGroup Information. + # Supports information from a single AdGroup. + # This field is optional for the following recommendation_types: + # KEYWORD + # @param seed_info [::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsRequest::SeedInfo, ::Hash] + # Optional. Seed information for Keywords. + # This field is necessary for the following recommendation_types: + # KEYWORD + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsRequest.new + # + # # Call the generate_recommendations method. + # result = client.generate_recommendations request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsResponse. + # p result + # + def generate_recommendations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_recommendations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_recommendations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_recommendations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommendation_service_stub.call_rpc :generate_recommendations, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the RecommendationService API. + # + # This class represents the configuration for RecommendationService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # apply_recommendation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.apply_recommendation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::RecommendationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.apply_recommendation.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the RecommendationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `apply_recommendation` + # @return [::Gapic::Config::Method] + # + attr_reader :apply_recommendation + ## + # RPC-specific configuration for `dismiss_recommendation` + # @return [::Gapic::Config::Method] + # + attr_reader :dismiss_recommendation + ## + # RPC-specific configuration for `generate_recommendations` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_recommendations + + # @private + def initialize parent_rpcs = nil + apply_recommendation_config = parent_rpcs.apply_recommendation if parent_rpcs.respond_to? :apply_recommendation + @apply_recommendation = ::Gapic::Config::Method.new apply_recommendation_config + dismiss_recommendation_config = parent_rpcs.dismiss_recommendation if parent_rpcs.respond_to? :dismiss_recommendation + @dismiss_recommendation = ::Gapic::Config::Method.new dismiss_recommendation_config + generate_recommendations_config = parent_rpcs.generate_recommendations if parent_rpcs.respond_to? :generate_recommendations + @generate_recommendations = ::Gapic::Config::Method.new generate_recommendations_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_service/credentials.rb b/lib/google/ads/google_ads/v16/services/recommendation_service/credentials.rb new file mode 100644 index 000000000..b4da9b1c5 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RecommendationService + # Credentials for the RecommendationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_service/paths.rb b/lib/google/ads/google_ads/v16/services/recommendation_service/paths.rb new file mode 100644 index 000000000..4371f5a1e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_service/paths.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RecommendationService + # Path helper methods for the RecommendationService API. + module Paths + ## + # Create a fully-qualified Ad resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/ads/{ad_id}` + # + # @param customer_id [String] + # @param ad_id [String] + # + # @return [::String] + def ad_path customer_id:, ad_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/ads/#{ad_id}" + end + + ## + # Create a fully-qualified AdGroup resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/adGroups/{ad_group_id}` + # + # @param customer_id [String] + # @param ad_group_id [String] + # + # @return [::String] + def ad_group_path customer_id:, ad_group_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/adGroups/#{ad_group_id}" + end + + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/assets/{asset_id}` + # + # @param customer_id [String] + # @param asset_id [String] + # + # @return [::String] + def asset_path customer_id:, asset_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/assets/#{asset_id}" + end + + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified CampaignBudget resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaignBudgets/{campaign_budget_id}` + # + # @param customer_id [String] + # @param campaign_budget_id [String] + # + # @return [::String] + def campaign_budget_path customer_id:, campaign_budget_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaignBudgets/#{campaign_budget_id}" + end + + ## + # Create a fully-qualified ConversionAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/conversionActions/{conversion_action_id}` + # + # @param customer_id [String] + # @param conversion_action_id [String] + # + # @return [::String] + def conversion_action_path customer_id:, conversion_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/conversionActions/#{conversion_action_id}" + end + + ## + # Create a fully-qualified Recommendation resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/recommendations/{recommendation_id}` + # + # @param customer_id [String] + # @param recommendation_id [String] + # + # @return [::String] + def recommendation_path customer_id:, recommendation_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/recommendations/#{recommendation_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_service_pb.rb b/lib/google/ads/google_ads/v16/services/recommendation_service_pb.rb new file mode 100644 index 000000000..b50c2a6a9 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_service_pb.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/recommendation_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/common/extensions_pb' +require 'google/ads/google_ads/v16/enums/ad_group_type_pb' +require 'google/ads/google_ads/v16/enums/advertising_channel_type_pb' +require 'google/ads/google_ads/v16/enums/bidding_strategy_type_pb' +require 'google/ads/google_ads/v16/enums/conversion_tracking_status_enum_pb' +require 'google/ads/google_ads/v16/enums/keyword_match_type_pb' +require 'google/ads/google_ads/v16/enums/recommendation_type_pb' +require 'google/ads/google_ads/v16/resources/ad_pb' +require 'google/ads/google_ads/v16/resources/asset_pb' +require 'google/ads/google_ads/v16/resources/recommendation_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n>google/ads/googleads/v16/services/recommendation_service.proto\x12!google.ads.googleads.v16.services\x1a.google/ads/googleads/v16/common/criteria.proto\x1a\x30google/ads/googleads/v16/common/extensions.proto\x1a\x32google/ads/googleads/v16/enums/ad_group_type.proto\x1a=google/ads/googleads/v16/enums/advertising_channel_type.proto\x1a:google/ads/googleads/v16/enums/bidding_strategy_type.proto\x1a\x44google/ads/googleads/v16/enums/conversion_tracking_status_enum.proto\x1a\x37google/ads/googleads/v16/enums/keyword_match_type.proto\x1a\x38google/ads/googleads/v16/enums/recommendation_type.proto\x1a+google/ads/googleads/v16/resources/ad.proto\x1a.google/ads/googleads/v16/resources/asset.proto\x1a\x37google/ads/googleads/v16/resources/recommendation.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xa9\x01\n\x1a\x41pplyRecommendationRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12X\n\noperations\x18\x02 \x03(\x0b\x32?.google.ads.googleads.v16.services.ApplyRecommendationOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\"\xf3/\n\x1c\x41pplyRecommendationOperation\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/Recommendation\x12s\n\x0f\x63\x61mpaign_budget\x18\x02 \x01(\x0b\x32X.google.ads.googleads.v16.services.ApplyRecommendationOperation.CampaignBudgetParametersH\x00\x12\x63\n\x07text_ad\x18\x03 \x01(\x0b\x32P.google.ads.googleads.v16.services.ApplyRecommendationOperation.TextAdParametersH\x00\x12\x64\n\x07keyword\x18\x04 \x01(\x0b\x32Q.google.ads.googleads.v16.services.ApplyRecommendationOperation.KeywordParametersH\x00\x12u\n\x11target_cpa_opt_in\x18\x05 \x01(\x0b\x32X.google.ads.googleads.v16.services.ApplyRecommendationOperation.TargetCpaOptInParametersH\x00\x12w\n\x12target_roas_opt_in\x18\n \x01(\x0b\x32Y.google.ads.googleads.v16.services.ApplyRecommendationOperation.TargetRoasOptInParametersH\x00\x12w\n\x11\x63\x61llout_extension\x18\x06 \x01(\x0b\x32Z.google.ads.googleads.v16.services.ApplyRecommendationOperation.CalloutExtensionParametersH\x00\x12q\n\x0e\x63\x61ll_extension\x18\x07 \x01(\x0b\x32W.google.ads.googleads.v16.services.ApplyRecommendationOperation.CallExtensionParametersH\x00\x12y\n\x12sitelink_extension\x18\x08 \x01(\x0b\x32[.google.ads.googleads.v16.services.ApplyRecommendationOperation.SitelinkExtensionParametersH\x00\x12x\n\x12move_unused_budget\x18\t \x01(\x0b\x32Z.google.ads.googleads.v16.services.ApplyRecommendationOperation.MoveUnusedBudgetParametersH\x00\x12|\n\x14responsive_search_ad\x18\x0b \x01(\x0b\x32\\.google.ads.googleads.v16.services.ApplyRecommendationOperation.ResponsiveSearchAdParametersH\x00\x12\x81\x01\n\x17use_broad_match_keyword\x18\x0c \x01(\x0b\x32^.google.ads.googleads.v16.services.ApplyRecommendationOperation.UseBroadMatchKeywordParametersH\x00\x12\x87\x01\n\x1aresponsive_search_ad_asset\x18\r \x01(\x0b\x32\x61.google.ads.googleads.v16.services.ApplyRecommendationOperation.ResponsiveSearchAdAssetParametersH\x00\x12\xa1\x01\n(responsive_search_ad_improve_ad_strength\x18\x0e \x01(\x0b\x32m.google.ads.googleads.v16.services.ApplyRecommendationOperation.ResponsiveSearchAdImproveAdStrengthParametersH\x00\x12\x89\x01\n\x1craise_target_cpa_bid_too_low\x18\x0f \x01(\x0b\x32\x61.google.ads.googleads.v16.services.ApplyRecommendationOperation.RaiseTargetCpaBidTooLowParametersH\x00\x12\x89\x01\n\x1b\x66orecasting_set_target_roas\x18\x10 \x01(\x0b\x32\x62.google.ads.googleads.v16.services.ApplyRecommendationOperation.ForecastingSetTargetRoasParametersH\x00\x12o\n\rcallout_asset\x18\x11 \x01(\x0b\x32V.google.ads.googleads.v16.services.ApplyRecommendationOperation.CalloutAssetParametersH\x00\x12i\n\ncall_asset\x18\x12 \x01(\x0b\x32S.google.ads.googleads.v16.services.ApplyRecommendationOperation.CallAssetParametersH\x00\x12q\n\x0esitelink_asset\x18\x13 \x01(\x0b\x32W.google.ads.googleads.v16.services.ApplyRecommendationOperation.SitelinkAssetParametersH\x00\x12t\n\x10raise_target_cpa\x18\x14 \x01(\x0b\x32X.google.ads.googleads.v16.services.ApplyRecommendationOperation.RaiseTargetCpaParametersH\x00\x12v\n\x11lower_target_roas\x18\x15 \x01(\x0b\x32Y.google.ads.googleads.v16.services.ApplyRecommendationOperation.LowerTargetRoasParametersH\x00\x12\x87\x01\n\x1a\x66orecasting_set_target_cpa\x18\x16 \x01(\x0b\x32\x61.google.ads.googleads.v16.services.ApplyRecommendationOperation.ForecastingSetTargetCpaParametersH\x00\x12{\n\x0eset_target_cpa\x18\x17 \x01(\x0b\x32\x61.google.ads.googleads.v16.services.ApplyRecommendationOperation.ForecastingSetTargetCpaParametersH\x00\x12}\n\x0fset_target_roas\x18\x18 \x01(\x0b\x32\x62.google.ads.googleads.v16.services.ApplyRecommendationOperation.ForecastingSetTargetRoasParametersH\x00\x12r\n\x0flead_form_asset\x18\x19 \x01(\x0b\x32W.google.ads.googleads.v16.services.ApplyRecommendationOperation.LeadFormAssetParametersH\x00\x1a^\n\x18\x43\x61mpaignBudgetParameters\x12%\n\x18new_budget_amount_micros\x18\x02 \x01(\x03H\x00\x88\x01\x01\x42\x1b\n\x19_new_budget_amount_micros\x1a\x9c\x01\n\"ForecastingSetTargetRoasParameters\x12\x18\n\x0btarget_roas\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12*\n\x1d\x63\x61mpaign_budget_amount_micros\x18\x02 \x01(\x03H\x01\x88\x01\x01\x42\x0e\n\x0c_target_roasB \n\x1e_campaign_budget_amount_micros\x1a\x46\n\x10TextAdParameters\x12\x32\n\x02\x61\x64\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.Ad\x1a\xc2\x01\n\x11KeywordParameters\x12\x15\n\x08\x61\x64_group\x18\x04 \x01(\tH\x00\x88\x01\x01\x12Y\n\nmatch_type\x18\x02 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.KeywordMatchTypeEnum.KeywordMatchType\x12\x1b\n\x0e\x63pc_bid_micros\x18\x05 \x01(\x03H\x01\x88\x01\x01\x42\x0b\n\t_ad_groupB\x11\n\x0f_cpc_bid_micros\x1a\xa6\x01\n\x18TargetCpaOptInParameters\x12\x1e\n\x11target_cpa_micros\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12.\n!new_campaign_budget_amount_micros\x18\x04 \x01(\x03H\x01\x88\x01\x01\x42\x14\n\x12_target_cpa_microsB$\n\"_new_campaign_budget_amount_micros\x1a\x9b\x01\n\x19TargetRoasOptInParameters\x12\x18\n\x0btarget_roas\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12.\n!new_campaign_budget_amount_micros\x18\x02 \x01(\x03H\x01\x88\x01\x01\x42\x0e\n\x0c_target_roasB$\n\"_new_campaign_budget_amount_micros\x1aj\n\x1a\x43\x61lloutExtensionParameters\x12L\n\x12\x63\x61llout_extensions\x18\x01 \x03(\x0b\x32\x30.google.ads.googleads.v16.common.CalloutFeedItem\x1a\x61\n\x17\x43\x61llExtensionParameters\x12\x46\n\x0f\x63\x61ll_extensions\x18\x01 \x03(\x0b\x32-.google.ads.googleads.v16.common.CallFeedItem\x1am\n\x1bSitelinkExtensionParameters\x12N\n\x13sitelink_extensions\x18\x01 \x03(\x0b\x32\x31.google.ads.googleads.v16.common.SitelinkFeedItem\x1a\x98\x01\n\x16\x43\x61lloutAssetParameters\x12~\n\x19\x61\x64_asset_apply_parameters\x18\x01 \x01(\x0b\x32V.google.ads.googleads.v16.services.ApplyRecommendationOperation.AdAssetApplyParametersB\x03\xe0\x41\x02\x1a\x95\x01\n\x13\x43\x61llAssetParameters\x12~\n\x19\x61\x64_asset_apply_parameters\x18\x01 \x01(\x0b\x32V.google.ads.googleads.v16.services.ApplyRecommendationOperation.AdAssetApplyParametersB\x03\xe0\x41\x02\x1a\x99\x01\n\x17SitelinkAssetParameters\x12~\n\x19\x61\x64_asset_apply_parameters\x18\x01 \x01(\x0b\x32V.google.ads.googleads.v16.services.ApplyRecommendationOperation.AdAssetApplyParametersB\x03\xe0\x41\x02\x1a>\n\x18RaiseTargetCpaParameters\x12\"\n\x15target_cpa_multiplier\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x1a@\n\x19LowerTargetRoasParameters\x12#\n\x16target_roas_multiplier\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x1a\xaf\x02\n\x16\x41\x64\x41ssetApplyParameters\x12=\n\nnew_assets\x18\x01 \x03(\x0b\x32).google.ads.googleads.v16.resources.Asset\x12\x17\n\x0f\x65xisting_assets\x18\x02 \x03(\t\x12u\n\x05scope\x18\x03 \x01(\x0e\x32\x61.google.ads.googleads.v16.services.ApplyRecommendationOperation.AdAssetApplyParameters.ApplyScopeB\x03\xe0\x41\x02\"F\n\nApplyScope\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x0c\n\x08\x43USTOMER\x10\x02\x12\x0c\n\x08\x43\x41MPAIGN\x10\x03\x1aZ\n\x1aMoveUnusedBudgetParameters\x12\"\n\x15\x62udget_micros_to_move\x18\x02 \x01(\x03H\x00\x88\x01\x01\x42\x18\n\x16_budget_micros_to_move\x1a_\n!ResponsiveSearchAdAssetParameters\x12:\n\nupdated_ad\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.Ad\x1ak\n-ResponsiveSearchAdImproveAdStrengthParameters\x12:\n\nupdated_ad\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.Ad\x1aW\n\x1cResponsiveSearchAdParameters\x12\x37\n\x02\x61\x64\x18\x01 \x01(\x0b\x32&.google.ads.googleads.v16.resources.AdB\x03\xe0\x41\x02\x1a\x43\n!RaiseTargetCpaBidTooLowParameters\x12\x1e\n\x11target_multiplier\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x1a\x64\n\x1eUseBroadMatchKeywordParameters\x12%\n\x18new_budget_amount_micros\x18\x01 \x01(\x03H\x00\x88\x01\x01\x42\x1b\n\x19_new_budget_amount_micros\x1a\xa7\x01\n!ForecastingSetTargetCpaParameters\x12\x1e\n\x11target_cpa_micros\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12*\n\x1d\x63\x61mpaign_budget_amount_micros\x18\x02 \x01(\x03H\x01\x88\x01\x01\x42\x14\n\x12_target_cpa_microsB \n\x1e_campaign_budget_amount_micros\x1a\xfd\x01\n\x17LeadFormAssetParameters\x12~\n\x19\x61\x64_asset_apply_parameters\x18\x01 \x01(\x0b\x32V.google.ads.googleads.v16.services.ApplyRecommendationOperation.AdAssetApplyParametersB\x03\xe0\x41\x02\x12\x35\n(set_submit_lead_form_asset_campaign_goal\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42+\n)_set_submit_lead_form_asset_campaign_goalB\x12\n\x10\x61pply_parameters\"\x9f\x01\n\x1b\x41pplyRecommendationResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.ads.googleads.v16.services.ApplyRecommendationResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"`\n\x19\x41pplyRecommendationResult\x12\x43\n\rresource_name\x18\x01 \x01(\tB,\xfa\x41)\n\'googleads.googleapis.com/Recommendation\"\x83\x02\n\x1c\x44ismissRecommendationRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12w\n\noperations\x18\x03 \x03(\x0b\x32^.google.ads.googleads.v16.services.DismissRecommendationRequest.DismissRecommendationOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x02 \x01(\x08\x1a\x37\n\x1e\x44ismissRecommendationOperation\x12\x15\n\rresource_name\x18\x01 \x01(\t\"\xf7\x01\n\x1d\x44ismissRecommendationResponse\x12m\n\x07results\x18\x01 \x03(\x0b\x32\\.google.ads.googleads.v16.services.DismissRecommendationResponse.DismissRecommendationResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x1a\x34\n\x1b\x44ismissRecommendationResult\x12\x15\n\rresource_name\x18\x01 \x01(\t\"\xf0\n\n\x1eGenerateRecommendationsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12l\n\x14recommendation_types\x18\x02 \x03(\x0e\x32I.google.ads.googleads.v16.enums.RecommendationTypeEnum.RecommendationTypeB\x03\xe0\x41\x02\x12x\n\x18\x61\x64vertising_channel_type\x18\x03 \x01(\x0e\x32Q.google.ads.googleads.v16.enums.AdvertisingChannelTypeEnum.AdvertisingChannelTypeB\x03\xe0\x41\x02\x12)\n\x17\x63\x61mpaign_sitelink_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x83\x01\n\x1a\x63onversion_tracking_status\x18\x05 \x01(\x0e\x32U.google.ads.googleads.v16.enums.ConversionTrackingStatusEnum.ConversionTrackingStatusB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12m\n\x0c\x62idding_info\x18\x06 \x01(\x0b\x32M.google.ads.googleads.v16.services.GenerateRecommendationsRequest.BiddingInfoB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12i\n\rad_group_info\x18\x07 \x03(\x0b\x32M.google.ads.googleads.v16.services.GenerateRecommendationsRequest.AdGroupInfoB\x03\xe0\x41\x01\x12g\n\tseed_info\x18\x08 \x01(\x0b\x32J.google.ads.googleads.v16.services.GenerateRecommendationsRequest.SeedInfoB\x03\xe0\x41\x01H\x03\x88\x01\x01\x1a\xec\x01\n\x0b\x42iddingInfo\x12o\n\x15\x62idding_strategy_type\x18\x01 \x01(\x0e\x32K.google.ads.googleads.v16.enums.BiddingStrategyTypeEnum.BiddingStrategyTypeH\x01\x88\x01\x01\x12\x1b\n\x11target_cpa_micros\x18\x02 \x01(\x03H\x00\x12\x15\n\x0btarget_roas\x18\x03 \x01(\x01H\x00\x42\x1e\n\x1c\x62idding_strategy_target_infoB\x18\n\x16_bidding_strategy_type\x1a\xc2\x01\n\x0b\x41\x64GroupInfo\x12\\\n\rad_group_type\x18\x01 \x01(\x0e\x32;.google.ads.googleads.v16.enums.AdGroupTypeEnum.AdGroupTypeB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x43\n\x08keywords\x18\x02 \x03(\x0b\x32,.google.ads.googleads.v16.common.KeywordInfoB\x03\xe0\x41\x01\x42\x10\n\x0e_ad_group_type\x1aJ\n\x08SeedInfo\x12\x15\n\x08url_seed\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rkeyword_seeds\x18\x03 \x03(\tB\x03\xe0\x41\x01\x42\x0b\n\t_url_seedB\x1a\n\x18_campaign_sitelink_countB\x1d\n\x1b_conversion_tracking_statusB\x0f\n\r_bidding_infoB\x0c\n\n_seed_info\"n\n\x1fGenerateRecommendationsResponse\x12K\n\x0frecommendations\x18\x01 \x03(\x0b\x32\x32.google.ads.googleads.v16.resources.Recommendation2\xeb\x06\n\x15RecommendationService\x12\xee\x01\n\x13\x41pplyRecommendation\x12=.google.ads.googleads.v16.services.ApplyRecommendationRequest\x1a>.google.ads.googleads.v16.services.ApplyRecommendationResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/recommendations:apply:\x01*\x12\xf6\x01\n\x15\x44ismissRecommendation\x12?.google.ads.googleads.v16.services.DismissRecommendationRequest\x1a@.google.ads.googleads.v16.services.DismissRecommendationResponse\"Z\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02;\"6/v16/customers/{customer_id=*}/recommendations:dismiss:\x01*\x12\xa0\x02\n\x17GenerateRecommendations\x12\x41.google.ads.googleads.v16.services.GenerateRecommendationsRequest\x1a\x42.google.ads.googleads.v16.services.GenerateRecommendationsResponse\"~\xda\x41\x39\x63ustomer_id,recommendation_types,advertising_channel_type\x82\xd3\xe4\x93\x02<\"7/v16/customers/{customer_id=*}/recommendations:generate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x86\x02\n%com.google.ads.googleads.v16.servicesB\x1aRecommendationServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.Ad", "google/ads/googleads/v16/resources/ad.proto"], + ["google.ads.googleads.v16.common.CalloutFeedItem", "google/ads/googleads/v16/common/extensions.proto"], + ["google.ads.googleads.v16.resources.Asset", "google/ads/googleads/v16/resources/asset.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.ads.googleads.v16.common.KeywordInfo", "google/ads/googleads/v16/common/criteria.proto"], + ["google.ads.googleads.v16.resources.Recommendation", "google/ads/googleads/v16/resources/recommendation.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + ApplyRecommendationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationRequest").msgclass + ApplyRecommendationOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation").msgclass + ApplyRecommendationOperation::CampaignBudgetParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.CampaignBudgetParameters").msgclass + ApplyRecommendationOperation::ForecastingSetTargetRoasParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.ForecastingSetTargetRoasParameters").msgclass + ApplyRecommendationOperation::TextAdParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.TextAdParameters").msgclass + ApplyRecommendationOperation::KeywordParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.KeywordParameters").msgclass + ApplyRecommendationOperation::TargetCpaOptInParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.TargetCpaOptInParameters").msgclass + ApplyRecommendationOperation::TargetRoasOptInParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.TargetRoasOptInParameters").msgclass + ApplyRecommendationOperation::CalloutExtensionParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.CalloutExtensionParameters").msgclass + ApplyRecommendationOperation::CallExtensionParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.CallExtensionParameters").msgclass + ApplyRecommendationOperation::SitelinkExtensionParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.SitelinkExtensionParameters").msgclass + ApplyRecommendationOperation::CalloutAssetParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.CalloutAssetParameters").msgclass + ApplyRecommendationOperation::CallAssetParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.CallAssetParameters").msgclass + ApplyRecommendationOperation::SitelinkAssetParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.SitelinkAssetParameters").msgclass + ApplyRecommendationOperation::RaiseTargetCpaParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.RaiseTargetCpaParameters").msgclass + ApplyRecommendationOperation::LowerTargetRoasParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.LowerTargetRoasParameters").msgclass + ApplyRecommendationOperation::AdAssetApplyParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.AdAssetApplyParameters").msgclass + ApplyRecommendationOperation::AdAssetApplyParameters::ApplyScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.AdAssetApplyParameters.ApplyScope").enummodule + ApplyRecommendationOperation::MoveUnusedBudgetParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.MoveUnusedBudgetParameters").msgclass + ApplyRecommendationOperation::ResponsiveSearchAdAssetParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.ResponsiveSearchAdAssetParameters").msgclass + ApplyRecommendationOperation::ResponsiveSearchAdImproveAdStrengthParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.ResponsiveSearchAdImproveAdStrengthParameters").msgclass + ApplyRecommendationOperation::ResponsiveSearchAdParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.ResponsiveSearchAdParameters").msgclass + ApplyRecommendationOperation::RaiseTargetCpaBidTooLowParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.RaiseTargetCpaBidTooLowParameters").msgclass + ApplyRecommendationOperation::UseBroadMatchKeywordParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.UseBroadMatchKeywordParameters").msgclass + ApplyRecommendationOperation::ForecastingSetTargetCpaParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.ForecastingSetTargetCpaParameters").msgclass + ApplyRecommendationOperation::LeadFormAssetParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationOperation.LeadFormAssetParameters").msgclass + ApplyRecommendationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationResponse").msgclass + ApplyRecommendationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.ApplyRecommendationResult").msgclass + DismissRecommendationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.DismissRecommendationRequest").msgclass + DismissRecommendationRequest::DismissRecommendationOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.DismissRecommendationRequest.DismissRecommendationOperation").msgclass + DismissRecommendationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.DismissRecommendationResponse").msgclass + DismissRecommendationResponse::DismissRecommendationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.DismissRecommendationResponse.DismissRecommendationResult").msgclass + GenerateRecommendationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateRecommendationsRequest").msgclass + GenerateRecommendationsRequest::BiddingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateRecommendationsRequest.BiddingInfo").msgclass + GenerateRecommendationsRequest::AdGroupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateRecommendationsRequest.AdGroupInfo").msgclass + GenerateRecommendationsRequest::SeedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateRecommendationsRequest.SeedInfo").msgclass + GenerateRecommendationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GenerateRecommendationsResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/recommendation_service_services_pb.rb new file mode 100644 index 000000000..b38a1e19c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_service_services_pb.rb @@ -0,0 +1,84 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/recommendation_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/recommendation_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + 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.v16.services.RecommendationService' + + # Applies given recommendations with corresponding apply parameters. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RecommendationError]() + # [RequestError]() + # [UrlFieldError]() + rpc :ApplyRecommendation, ::Google::Ads::GoogleAds::V16::Services::ApplyRecommendationRequest, ::Google::Ads::GoogleAds::V16::Services::ApplyRecommendationResponse + # Dismisses given recommendations. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RecommendationError]() + # [RequestError]() + rpc :DismissRecommendation, ::Google::Ads::GoogleAds::V16::Services::DismissRecommendationRequest, ::Google::Ads::GoogleAds::V16::Services::DismissRecommendationResponse + # Generates Recommendations based off the requested recommendation_types. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RecommendationError]() + # [RequestError]() + rpc :GenerateRecommendations, ::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsRequest, ::Google::Ads::GoogleAds::V16::Services::GenerateRecommendationsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_subscription_service.rb b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service.rb new file mode 100644 index 000000000..b130588af --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/recommendation_subscription_service/credentials" +require "google/ads/google_ads/v16/services/recommendation_subscription_service/paths" +require "google/ads/google_ads/v16/services/recommendation_subscription_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage recommendation subscriptions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/recommendation_subscription_service" + # client = ::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client.new + # + module RecommendationSubscriptionService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "recommendation_subscription_service", "helpers.rb" +require "google/ads/google_ads/v16/services/recommendation_subscription_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/client.rb b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/client.rb new file mode 100644 index 000000000..e38432034 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/client.rb @@ -0,0 +1,452 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/recommendation_subscription_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RecommendationSubscriptionService + ## + # Client for the RecommendationSubscriptionService service. + # + # Service to manage recommendation subscriptions. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recommendation_subscription_service_stub + + ## + # Configure the RecommendationSubscriptionService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RecommendationSubscriptionService clients + # ::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RecommendationSubscriptionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @recommendation_subscription_service_stub.universe_domain + end + + ## + # Create a new RecommendationSubscriptionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RecommendationSubscriptionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/recommendation_subscription_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @recommendation_subscription_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Mutates given subscription with corresponding apply parameters. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RecommendationError]() + # [RequestError]() + # [UrlFieldError]() + # + # @overload mutate_recommendation_subscription(request, options = nil) + # Pass arguments to `mutate_recommendation_subscription` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_recommendation_subscription(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_recommendation_subscription` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the subscribing customer. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionOperation, ::Hash>] + # Required. The list of create or update operations. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. The mutable + # resource will only be returned if the resource has the appropriate response + # field. For example, MutateCampaignResult.campaign. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionRequest.new + # + # # Call the mutate_recommendation_subscription method. + # result = client.mutate_recommendation_subscription request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionResponse. + # p result + # + def mutate_recommendation_subscription request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_recommendation_subscription.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_recommendation_subscription.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_recommendation_subscription.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommendation_subscription_service_stub.call_rpc :mutate_recommendation_subscription, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the RecommendationSubscriptionService API. + # + # This class represents the configuration for RecommendationSubscriptionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_recommendation_subscription to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_recommendation_subscription.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::RecommendationSubscriptionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_recommendation_subscription.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the RecommendationSubscriptionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_recommendation_subscription` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_recommendation_subscription + + # @private + def initialize parent_rpcs = nil + mutate_recommendation_subscription_config = parent_rpcs.mutate_recommendation_subscription if parent_rpcs.respond_to? :mutate_recommendation_subscription + @mutate_recommendation_subscription = ::Gapic::Config::Method.new mutate_recommendation_subscription_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/credentials.rb b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/credentials.rb new file mode 100644 index 000000000..4e927e830 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RecommendationSubscriptionService + # Credentials for the RecommendationSubscriptionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/paths.rb b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/paths.rb new file mode 100644 index 000000000..2a8048b9b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RecommendationSubscriptionService + # Path helper methods for the RecommendationSubscriptionService API. + module Paths + ## + # Create a fully-qualified RecommendationSubscription resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/recommendationSubscriptions/{recommendation_type}` + # + # @param customer_id [String] + # @param recommendation_type [String] + # + # @return [::String] + def recommendation_subscription_path customer_id:, recommendation_type: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/recommendationSubscriptions/#{recommendation_type}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_subscription_service_pb.rb b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service_pb.rb new file mode 100644 index 000000000..d7c289922 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/recommendation_subscription_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/recommendation_subscription_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nKgoogle/ads/googleads/v16/services/recommendation_subscription_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x44google/ads/googleads/v16/resources/recommendation_subscription.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xc0\x02\n\'MutateRecommendationSubscriptionRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12_\n\noperations\x18\x02 \x03(\x0b\x32\x46.google.ads.googleads.v16.services.RecommendationSubscriptionOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x8c\x02\n#RecommendationSubscriptionOperation\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12P\n\x06\x63reate\x18\x01 \x01(\x0b\x32>.google.ads.googleads.v16.resources.RecommendationSubscriptionH\x00\x12P\n\x06update\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.resources.RecommendationSubscriptionH\x00\x42\x0b\n\toperation\"\xb9\x01\n(MutateRecommendationSubscriptionResponse\x12Z\n\x07results\x18\x01 \x03(\x0b\x32I.google.ads.googleads.v16.services.MutateRecommendationSubscriptionResult\x12\x31\n\x15partial_failure_error\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"\xde\x01\n&MutateRecommendationSubscriptionResult\x12O\n\rresource_name\x18\x01 \x01(\tB8\xfa\x41\x35\n3googleads.googleapis.com/RecommendationSubscription\x12\x63\n\x1brecommendation_subscription\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.resources.RecommendationSubscription2\xa9\x03\n!RecommendationSubscriptionService\x12\xbc\x02\n MutateRecommendationSubscription\x12J.google.ads.googleads.v16.services.MutateRecommendationSubscriptionRequest\x1aK.google.ads.googleads.v16.services.MutateRecommendationSubscriptionResponse\"\x7f\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02`\"[/v16/customers/{customer_id=*}/recommendationSubscriptions:mutateRecommendationSubscription:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x92\x02\n%com.google.ads.googleads.v16.servicesB&RecommendationSubscriptionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.RecommendationSubscription", "google/ads/googleads/v16/resources/recommendation_subscription.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateRecommendationSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateRecommendationSubscriptionRequest").msgclass + RecommendationSubscriptionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.RecommendationSubscriptionOperation").msgclass + MutateRecommendationSubscriptionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateRecommendationSubscriptionResponse").msgclass + MutateRecommendationSubscriptionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateRecommendationSubscriptionResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/recommendation_subscription_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service_services_pb.rb new file mode 100644 index 000000000..44ff13cfe --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/recommendation_subscription_service_services_pb.rb @@ -0,0 +1,62 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/recommendation_subscription_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/recommendation_subscription_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RecommendationSubscriptionService + # Proto file describing the Recommendation service. + # + # Service to manage recommendation subscriptions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.RecommendationSubscriptionService' + + # Mutates given subscription with corresponding apply parameters. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [QuotaError]() + # [RecommendationError]() + # [RequestError]() + # [UrlFieldError]() + rpc :MutateRecommendationSubscription, ::Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionRequest, ::Google::Ads::GoogleAds::V16::Services::MutateRecommendationSubscriptionResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/remarketing_action_service.rb b/lib/google/ads/google_ads/v16/services/remarketing_action_service.rb new file mode 100644 index 000000000..67fa31e99 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/remarketing_action_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/remarketing_action_service/credentials" +require "google/ads/google_ads/v16/services/remarketing_action_service/paths" +require "google/ads/google_ads/v16/services/remarketing_action_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage remarketing actions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/remarketing_action_service" + # client = ::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client.new + # + module RemarketingActionService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "remarketing_action_service", "helpers.rb" +require "google/ads/google_ads/v16/services/remarketing_action_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/remarketing_action_service/client.rb b/lib/google/ads/google_ads/v16/services/remarketing_action_service/client.rb new file mode 100644 index 000000000..5de6c549b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/remarketing_action_service/client.rb @@ -0,0 +1,445 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/remarketing_action_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RemarketingActionService + ## + # Client for the RemarketingActionService service. + # + # Service to manage remarketing actions. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :remarketing_action_service_stub + + ## + # Configure the RemarketingActionService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RemarketingActionService clients + # ::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RemarketingActionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @remarketing_action_service_stub.universe_domain + end + + ## + # Create a new RemarketingActionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RemarketingActionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/remarketing_action_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @remarketing_action_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or updates remarketing actions. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ConversionActionError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload mutate_remarketing_actions(request, options = nil) + # Pass arguments to `mutate_remarketing_actions` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_remarketing_actions(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_remarketing_actions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose remarketing actions are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::RemarketingActionOperation, ::Hash>] + # Required. The list of operations to perform on individual remarketing + # actions. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsRequest.new + # + # # Call the mutate_remarketing_actions method. + # result = client.mutate_remarketing_actions request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsResponse. + # p result + # + def mutate_remarketing_actions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_remarketing_actions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_remarketing_actions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_remarketing_actions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @remarketing_action_service_stub.call_rpc :mutate_remarketing_actions, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the RemarketingActionService API. + # + # This class represents the configuration for RemarketingActionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_remarketing_actions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_remarketing_actions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::RemarketingActionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_remarketing_actions.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the RemarketingActionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_remarketing_actions` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_remarketing_actions + + # @private + def initialize parent_rpcs = nil + mutate_remarketing_actions_config = parent_rpcs.mutate_remarketing_actions if parent_rpcs.respond_to? :mutate_remarketing_actions + @mutate_remarketing_actions = ::Gapic::Config::Method.new mutate_remarketing_actions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/remarketing_action_service/credentials.rb b/lib/google/ads/google_ads/v16/services/remarketing_action_service/credentials.rb new file mode 100644 index 000000000..bb3f81069 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/remarketing_action_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RemarketingActionService + # Credentials for the RemarketingActionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/remarketing_action_service/paths.rb b/lib/google/ads/google_ads/v16/services/remarketing_action_service/paths.rb new file mode 100644 index 000000000..55b268747 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/remarketing_action_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RemarketingActionService + # Path helper methods for the RemarketingActionService API. + module Paths + ## + # Create a fully-qualified RemarketingAction resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/remarketingActions/{remarketing_action_id}` + # + # @param customer_id [String] + # @param remarketing_action_id [String] + # + # @return [::String] + def remarketing_action_path customer_id:, remarketing_action_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/remarketingActions/#{remarketing_action_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/remarketing_action_service_pb.rb b/lib/google/ads/google_ads/v16/services/remarketing_action_service_pb.rb new file mode 100644 index 000000000..0657e707c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/remarketing_action_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/remarketing_action_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/remarketing_action_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nBgoogle/ads/googleads/v16/services/remarketing_action_service.proto\x12!google.ads.googleads.v16.services\x1a;google/ads/googleads/v16/resources/remarketing_action.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xc3\x01\n\x1fMutateRemarketingActionsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12V\n\noperations\x18\x02 \x03(\x0b\x32=.google.ads.googleads.v16.services.RemarketingActionOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xec\x01\n\x1aRemarketingActionOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12G\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.RemarketingActionH\x00\x12G\n\x06update\x18\x02 \x01(\x0b\x32\x35.google.ads.googleads.v16.resources.RemarketingActionH\x00\x42\x0b\n\toperation\"\xa8\x01\n MutateRemarketingActionsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12Q\n\x07results\x18\x02 \x03(\x0b\x32@.google.ads.googleads.v16.services.MutateRemarketingActionResult\"g\n\x1dMutateRemarketingActionResult\x12\x46\n\rresource_name\x18\x01 \x01(\tB/\xfa\x41,\n*googleads.googleapis.com/RemarketingAction2\xe5\x02\n\x18RemarketingActionService\x12\x81\x02\n\x18MutateRemarketingActions\x12\x42.google.ads.googleads.v16.services.MutateRemarketingActionsRequest\x1a\x43.google.ads.googleads.v16.services.MutateRemarketingActionsResponse\"\\\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02=\"8/v16/customers/{customer_id=*}/remarketingActions:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x89\x02\n%com.google.ads.googleads.v16.servicesB\x1dRemarketingActionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.RemarketingAction", "google/ads/googleads/v16/resources/remarketing_action.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateRemarketingActionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateRemarketingActionsRequest").msgclass + RemarketingActionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.RemarketingActionOperation").msgclass + MutateRemarketingActionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateRemarketingActionsResponse").msgclass + MutateRemarketingActionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateRemarketingActionResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/remarketing_action_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/remarketing_action_service_services_pb.rb new file mode 100644 index 000000000..e50484653 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/remarketing_action_service_services_pb.rb @@ -0,0 +1,58 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/remarketing_action_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/remarketing_action_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module RemarketingActionService + # Proto file describing the Remarketing Action service. + # + # Service to manage remarketing actions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.RemarketingActionService' + + # Creates or updates remarketing actions. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [ConversionActionError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :MutateRemarketingActions, ::Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateRemarketingActionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_criterion_service.rb b/lib/google/ads/google_ads/v16/services/shared_criterion_service.rb new file mode 100644 index 000000000..0a802503c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_criterion_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/shared_criterion_service/credentials" +require "google/ads/google_ads/v16/services/shared_criterion_service/paths" +require "google/ads/google_ads/v16/services/shared_criterion_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage shared criteria. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/shared_criterion_service" + # client = ::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client.new + # + module SharedCriterionService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "shared_criterion_service", "helpers.rb" +require "google/ads/google_ads/v16/services/shared_criterion_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/shared_criterion_service/client.rb b/lib/google/ads/google_ads/v16/services/shared_criterion_service/client.rb new file mode 100644 index 000000000..f124673db --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_criterion_service/client.rb @@ -0,0 +1,459 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/shared_criterion_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SharedCriterionService + ## + # Client for the SharedCriterionService service. + # + # Service to manage shared criteria. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :shared_criterion_service_stub + + ## + # Configure the SharedCriterionService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SharedCriterionService clients + # ::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SharedCriterionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @shared_criterion_service_stub.universe_domain + end + + ## + # Create a new SharedCriterionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SharedCriterionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/shared_criterion_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @shared_criterion_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or removes shared criteria. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CriterionError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_shared_criteria(request, options = nil) + # Pass arguments to `mutate_shared_criteria` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_shared_criteria(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_shared_criteria` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose shared criteria are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::SharedCriterionOperation, ::Hash>] + # Required. The list of operations to perform on individual shared criteria. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaRequest.new + # + # # Call the mutate_shared_criteria method. + # result = client.mutate_shared_criteria request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaResponse. + # p result + # + def mutate_shared_criteria request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_shared_criteria.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_shared_criteria.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_shared_criteria.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @shared_criterion_service_stub.call_rpc :mutate_shared_criteria, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the SharedCriterionService API. + # + # This class represents the configuration for SharedCriterionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_shared_criteria to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_shared_criteria.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::SharedCriterionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_shared_criteria.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SharedCriterionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_shared_criteria` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_shared_criteria + + # @private + def initialize parent_rpcs = nil + mutate_shared_criteria_config = parent_rpcs.mutate_shared_criteria if parent_rpcs.respond_to? :mutate_shared_criteria + @mutate_shared_criteria = ::Gapic::Config::Method.new mutate_shared_criteria_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_criterion_service/credentials.rb b/lib/google/ads/google_ads/v16/services/shared_criterion_service/credentials.rb new file mode 100644 index 000000000..edfd19cff --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_criterion_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SharedCriterionService + # Credentials for the SharedCriterionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_criterion_service/paths.rb b/lib/google/ads/google_ads/v16/services/shared_criterion_service/paths.rb new file mode 100644 index 000000000..a1833a45d --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_criterion_service/paths.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SharedCriterionService + # Path helper methods for the SharedCriterionService API. + module Paths + ## + # Create a fully-qualified MobileAppCategoryConstant resource string. + # + # The resource will be in the following format: + # + # `mobileAppCategoryConstants/{mobile_app_category_id}` + # + # @param mobile_app_category_id [String] + # + # @return [::String] + def mobile_app_category_constant_path mobile_app_category_id: + "mobileAppCategoryConstants/#{mobile_app_category_id}" + end + + ## + # Create a fully-qualified SharedCriterion resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}` + # + # @param customer_id [String] + # @param shared_set_id [String] + # @param criterion_id [String] + # + # @return [::String] + def shared_criterion_path customer_id:, shared_set_id:, criterion_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + raise ::ArgumentError, "shared_set_id cannot contain /" if shared_set_id.to_s.include? "/" + + "customers/#{customer_id}/sharedCriteria/#{shared_set_id}~#{criterion_id}" + end + + ## + # Create a fully-qualified SharedSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/sharedSets/{shared_set_id}` + # + # @param customer_id [String] + # @param shared_set_id [String] + # + # @return [::String] + def shared_set_path customer_id:, shared_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/sharedSets/#{shared_set_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_criterion_service_pb.rb b/lib/google/ads/google_ads/v16/services/shared_criterion_service_pb.rb new file mode 100644 index 000000000..ede203138 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_criterion_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/shared_criterion_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/shared_criterion_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n@google/ads/googleads/v16/services/shared_criterion_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x39google/ads/googleads/v16/resources/shared_criterion.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/rpc/status.proto\"\xa9\x02\n\x1bMutateSharedCriteriaRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12T\n\noperations\x18\x02 \x03(\x0b\x32;.google.ads.googleads.v16.services.SharedCriterionOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\xaf\x01\n\x18SharedCriterionOperation\x12\x45\n\x06\x63reate\x18\x01 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.SharedCriterionH\x00\x12?\n\x06remove\x18\x03 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/SharedCriterionH\x00\x42\x0b\n\toperation\"\xa2\x01\n\x1cMutateSharedCriteriaResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12O\n\x07results\x18\x02 \x03(\x0b\x32>.google.ads.googleads.v16.services.MutateSharedCriterionResult\"\xb2\x01\n\x1bMutateSharedCriterionResult\x12\x44\n\rresource_name\x18\x01 \x01(\tB-\xfa\x41*\n(googleads.googleapis.com/SharedCriterion\x12M\n\x10shared_criterion\x18\x02 \x01(\x0b\x32\x33.google.ads.googleads.v16.resources.SharedCriterion2\xd3\x02\n\x16SharedCriterionService\x12\xf1\x01\n\x14MutateSharedCriteria\x12>.google.ads.googleads.v16.services.MutateSharedCriteriaRequest\x1a?.google.ads.googleads.v16.services.MutateSharedCriteriaResponse\"X\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x39\"4/v16/customers/{customer_id=*}/sharedCriteria:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x87\x02\n%com.google.ads.googleads.v16.servicesB\x1bSharedCriterionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.SharedCriterion", "google/ads/googleads/v16/resources/shared_criterion.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateSharedCriteriaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSharedCriteriaRequest").msgclass + SharedCriterionOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SharedCriterionOperation").msgclass + MutateSharedCriteriaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSharedCriteriaResponse").msgclass + MutateSharedCriterionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSharedCriterionResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_criterion_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/shared_criterion_service_services_pb.rb new file mode 100644 index 000000000..02a843954 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_criterion_service_services_pb.rb @@ -0,0 +1,71 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/shared_criterion_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/shared_criterion_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SharedCriterionService + # Proto file describing the Shared Criterion service. + # + # Service to manage shared criteria. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.SharedCriterionService' + + # Creates or removes shared criteria. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CriterionError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateSharedCriteria, ::Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaRequest, ::Google::Ads::GoogleAds::V16::Services::MutateSharedCriteriaResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_set_service.rb b/lib/google/ads/google_ads/v16/services/shared_set_service.rb new file mode 100644 index 000000000..917259a5c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_set_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/shared_set_service/credentials" +require "google/ads/google_ads/v16/services/shared_set_service/paths" +require "google/ads/google_ads/v16/services/shared_set_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage shared sets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/shared_set_service" + # client = ::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client.new + # + module SharedSetService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "shared_set_service", "helpers.rb" +require "google/ads/google_ads/v16/services/shared_set_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/shared_set_service/client.rb b/lib/google/ads/google_ads/v16/services/shared_set_service/client.rb new file mode 100644 index 000000000..c7b0213ae --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_set_service/client.rb @@ -0,0 +1,462 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/shared_set_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SharedSetService + ## + # Client for the SharedSetService service. + # + # Service to manage shared sets. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :shared_set_service_stub + + ## + # Configure the SharedSetService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SharedSetService clients + # ::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SharedSetService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @shared_set_service_stub.universe_domain + end + + ## + # Create a new SharedSetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SharedSetService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/shared_set_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @shared_set_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::SharedSetService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates, updates, or removes shared sets. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SharedSetError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + # + # @overload mutate_shared_sets(request, options = nil) + # Pass arguments to `mutate_shared_sets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateSharedSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateSharedSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_shared_sets(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_shared_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose shared sets are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::SharedSetOperation, ::Hash>] + # Required. The list of operations to perform on individual shared sets. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateSharedSetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateSharedSetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::SharedSetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateSharedSetsRequest.new + # + # # Call the mutate_shared_sets method. + # result = client.mutate_shared_sets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateSharedSetsResponse. + # p result + # + def mutate_shared_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateSharedSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_shared_sets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_shared_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_shared_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @shared_set_service_stub.call_rpc :mutate_shared_sets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the SharedSetService API. + # + # This class represents the configuration for SharedSetService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_shared_sets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_shared_sets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::SharedSetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_shared_sets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SharedSetService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_shared_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_shared_sets + + # @private + def initialize parent_rpcs = nil + mutate_shared_sets_config = parent_rpcs.mutate_shared_sets if parent_rpcs.respond_to? :mutate_shared_sets + @mutate_shared_sets = ::Gapic::Config::Method.new mutate_shared_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_set_service/credentials.rb b/lib/google/ads/google_ads/v16/services/shared_set_service/credentials.rb new file mode 100644 index 000000000..6dd464649 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_set_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SharedSetService + # Credentials for the SharedSetService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_set_service/paths.rb b/lib/google/ads/google_ads/v16/services/shared_set_service/paths.rb new file mode 100644 index 000000000..929416aef --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_set_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SharedSetService + # Path helper methods for the SharedSetService API. + module Paths + ## + # Create a fully-qualified SharedSet resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/sharedSets/{shared_set_id}` + # + # @param customer_id [String] + # @param shared_set_id [String] + # + # @return [::String] + def shared_set_path customer_id:, shared_set_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/sharedSets/#{shared_set_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_set_service_pb.rb b/lib/google/ads/google_ads/v16/services/shared_set_service_pb.rb new file mode 100644 index 000000000..0007e402a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_set_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/shared_set_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/resources/shared_set_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n:google/ads/googleads/v16/services/shared_set_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1a\x33google/ads/googleads/v16/resources/shared_set.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\x9f\x02\n\x17MutateSharedSetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12N\n\noperations\x18\x02 \x03(\x0b\x32\x35.google.ads.googleads.v16.services.SharedSetOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x8f\x02\n\x12SharedSetOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12?\n\x06\x63reate\x18\x01 \x01(\x0b\x32-.google.ads.googleads.v16.resources.SharedSetH\x00\x12?\n\x06update\x18\x02 \x01(\x0b\x32-.google.ads.googleads.v16.resources.SharedSetH\x00\x12\x39\n\x06remove\x18\x03 \x01(\tB\'\xfa\x41$\n\"googleads.googleapis.com/SharedSetH\x00\x42\x0b\n\toperation\"\x98\x01\n\x18MutateSharedSetsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12I\n\x07results\x18\x02 \x03(\x0b\x32\x38.google.ads.googleads.v16.services.MutateSharedSetResult\"\x9a\x01\n\x15MutateSharedSetResult\x12>\n\rresource_name\x18\x01 \x01(\tB\'\xfa\x41$\n\"googleads.googleapis.com/SharedSet\x12\x41\n\nshared_set\x18\x02 \x01(\x0b\x32-.google.ads.googleads.v16.resources.SharedSet2\xbd\x02\n\x10SharedSetService\x12\xe1\x01\n\x10MutateSharedSets\x12:.google.ads.googleads.v16.services.MutateSharedSetsRequest\x1a;.google.ads.googleads.v16.services.MutateSharedSetsResponse\"T\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x35\"0/v16/customers/{customer_id=*}/sharedSets:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x81\x02\n%com.google.ads.googleads.v16.servicesB\x15SharedSetServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.SharedSet", "google/ads/googleads/v16/resources/shared_set.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateSharedSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSharedSetsRequest").msgclass + SharedSetOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SharedSetOperation").msgclass + MutateSharedSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSharedSetsResponse").msgclass + MutateSharedSetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSharedSetResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/shared_set_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/shared_set_service_services_pb.rb new file mode 100644 index 000000000..646bfa320 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/shared_set_service_services_pb.rb @@ -0,0 +1,74 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/shared_set_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/shared_set_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SharedSetService + # Proto file describing the Shared Set service. + # + # Service to manage shared sets. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.SharedSetService' + + # Creates, updates, or removes shared sets. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [DatabaseError]() + # [DateError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [IdError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotEmptyError]() + # [NullError]() + # [OperatorError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [ResourceCountLimitExceededError]() + # [SharedSetError]() + # [SizeLimitError]() + # [StringFormatError]() + # [StringLengthError]() + rpc :MutateSharedSets, ::Google::Ads::GoogleAds::V16::Services::MutateSharedSetsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateSharedSetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service.rb new file mode 100644 index 000000000..82d57f5d8 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/smart_campaign_setting_service/credentials" +require "google/ads/google_ads/v16/services/smart_campaign_setting_service/paths" +require "google/ads/google_ads/v16/services/smart_campaign_setting_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage Smart campaign settings. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/smart_campaign_setting_service" + # client = ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client.new + # + module SmartCampaignSettingService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "smart_campaign_setting_service", "helpers.rb" +require "google/ads/google_ads/v16/services/smart_campaign_setting_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/client.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/client.rb new file mode 100644 index 000000000..ea7036b19 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/client.rb @@ -0,0 +1,534 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/smart_campaign_setting_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SmartCampaignSettingService + ## + # Client for the SmartCampaignSettingService service. + # + # Service to manage Smart campaign settings. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :smart_campaign_setting_service_stub + + ## + # Configure the SmartCampaignSettingService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SmartCampaignSettingService clients + # ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SmartCampaignSettingService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @smart_campaign_setting_service_stub.universe_domain + end + + ## + # Create a new SmartCampaignSettingService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SmartCampaignSettingService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/smart_campaign_setting_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @smart_campaign_setting_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns the status of the requested Smart campaign. + # + # @overload get_smart_campaign_status(request, options = nil) + # Pass arguments to `get_smart_campaign_status` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_smart_campaign_status(resource_name: nil) + # Pass arguments to `get_smart_campaign_status` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Required. The resource name of the Smart campaign setting belonging to the + # Smart campaign to fetch the status of. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusRequest.new + # + # # Call the get_smart_campaign_status method. + # result = client.get_smart_campaign_status request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusResponse. + # p result + # + def get_smart_campaign_status request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_smart_campaign_status.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_smart_campaign_status.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_smart_campaign_status.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @smart_campaign_setting_service_stub.call_rpc :get_smart_campaign_status, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Updates Smart campaign settings for campaigns. + # + # @overload mutate_smart_campaign_settings(request, options = nil) + # Pass arguments to `mutate_smart_campaign_settings` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_smart_campaign_settings(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil) + # Pass arguments to `mutate_smart_campaign_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose Smart campaign settings are being + # modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingOperation, ::Hash>] + # Required. The list of operations to perform on individual Smart campaign + # settings. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # @param response_content_type [::Google::Ads::GoogleAds::V16::Enums::ResponseContentTypeEnum::ResponseContentType] + # The response content type setting. Determines whether the mutable resource + # or just the resource name should be returned post mutation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsRequest.new + # + # # Call the mutate_smart_campaign_settings method. + # result = client.mutate_smart_campaign_settings request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsResponse. + # p result + # + def mutate_smart_campaign_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_smart_campaign_settings.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_smart_campaign_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_smart_campaign_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @smart_campaign_setting_service_stub.call_rpc :mutate_smart_campaign_settings, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the SmartCampaignSettingService API. + # + # This class represents the configuration for SmartCampaignSettingService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_smart_campaign_status to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_smart_campaign_status.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSettingService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_smart_campaign_status.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SmartCampaignSettingService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_smart_campaign_status` + # @return [::Gapic::Config::Method] + # + attr_reader :get_smart_campaign_status + ## + # RPC-specific configuration for `mutate_smart_campaign_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_smart_campaign_settings + + # @private + def initialize parent_rpcs = nil + get_smart_campaign_status_config = parent_rpcs.get_smart_campaign_status if parent_rpcs.respond_to? :get_smart_campaign_status + @get_smart_campaign_status = ::Gapic::Config::Method.new get_smart_campaign_status_config + mutate_smart_campaign_settings_config = parent_rpcs.mutate_smart_campaign_settings if parent_rpcs.respond_to? :mutate_smart_campaign_settings + @mutate_smart_campaign_settings = ::Gapic::Config::Method.new mutate_smart_campaign_settings_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/credentials.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/credentials.rb new file mode 100644 index 000000000..791b24d4a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SmartCampaignSettingService + # Credentials for the SmartCampaignSettingService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/paths.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/paths.rb new file mode 100644 index 000000000..7aaa28272 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SmartCampaignSettingService + # Path helper methods for the SmartCampaignSettingService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified SmartCampaignSetting resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/smartCampaignSettings/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def smart_campaign_setting_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/smartCampaignSettings/#{campaign_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service_pb.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service_pb.rb new file mode 100644 index 000000000..75cdc23dd --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service_pb.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/smart_campaign_setting_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/response_content_type_pb' +require 'google/ads/google_ads/v16/enums/smart_campaign_not_eligible_reason_pb' +require 'google/ads/google_ads/v16/enums/smart_campaign_status_pb' +require 'google/ads/google_ads/v16/resources/smart_campaign_setting_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/services/smart_campaign_setting_service.proto\x12!google.ads.googleads.v16.services\x1a:google/ads/googleads/v16/enums/response_content_type.proto\x1aGgoogle/ads/googleads/v16/enums/smart_campaign_not_eligible_reason.proto\x1a:google/ads/googleads/v16/enums/smart_campaign_status.proto\x1a?google/ads/googleads/v16/resources/smart_campaign_setting.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"m\n\x1dGetSmartCampaignStatusRequest\x12L\n\rresource_name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-googleads.googleapis.com/SmartCampaignSetting\"\xbf\x01\n\x1fSmartCampaignNotEligibleDetails\x12\x83\x01\n\x13not_eligible_reason\x18\x01 \x01(\x0e\x32\x61.google.ads.googleads.v16.enums.SmartCampaignNotEligibleReasonEnum.SmartCampaignNotEligibleReasonH\x00\x88\x01\x01\x42\x16\n\x14_not_eligible_reason\"\x92\x01\n\x1cSmartCampaignEligibleDetails\x12&\n\x19last_impression_date_time\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rend_date_time\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x1c\n\x1a_last_impression_date_timeB\x10\n\x0e_end_date_time\"P\n\x1aSmartCampaignPausedDetails\x12\x1d\n\x10paused_date_time\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x13\n\x11_paused_date_time\"S\n\x1bSmartCampaignRemovedDetails\x12\x1e\n\x11removed_date_time\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x14\n\x12_removed_date_time\"I\n\x19SmartCampaignEndedDetails\x12\x1a\n\rend_date_time\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x10\n\x0e_end_date_time\"\xf9\x04\n\x1eGetSmartCampaignStatusResponse\x12j\n\x15smart_campaign_status\x18\x01 \x01(\x0e\x32K.google.ads.googleads.v16.enums.SmartCampaignStatusEnum.SmartCampaignStatus\x12\x62\n\x14not_eligible_details\x18\x02 \x01(\x0b\x32\x42.google.ads.googleads.v16.services.SmartCampaignNotEligibleDetailsH\x00\x12[\n\x10\x65ligible_details\x18\x03 \x01(\x0b\x32?.google.ads.googleads.v16.services.SmartCampaignEligibleDetailsH\x00\x12W\n\x0epaused_details\x18\x04 \x01(\x0b\x32=.google.ads.googleads.v16.services.SmartCampaignPausedDetailsH\x00\x12Y\n\x0fremoved_details\x18\x05 \x01(\x0b\x32>.google.ads.googleads.v16.services.SmartCampaignRemovedDetailsH\x00\x12U\n\rended_details\x18\x06 \x01(\x0b\x32<.google.ads.googleads.v16.services.SmartCampaignEndedDetailsH\x00\x42\x1f\n\x1dsmart_campaign_status_details\"\xb5\x02\n\"MutateSmartCampaignSettingsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Y\n\noperations\x18\x02 \x03(\x0b\x32@.google.ads.googleads.v16.services.SmartCampaignSettingOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x12j\n\x15response_content_type\x18\x05 \x01(\x0e\x32K.google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType\"\x9a\x01\n\x1dSmartCampaignSettingOperation\x12H\n\x06update\x18\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.SmartCampaignSetting\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xae\x01\n#MutateSmartCampaignSettingsResponse\x12\x31\n\x15partial_failure_error\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12T\n\x07results\x18\x02 \x03(\x0b\x32\x43.google.ads.googleads.v16.services.MutateSmartCampaignSettingResult\"\xc7\x01\n MutateSmartCampaignSettingResult\x12I\n\rresource_name\x18\x01 \x01(\tB2\xfa\x41/\n-googleads.googleapis.com/SmartCampaignSetting\x12X\n\x16smart_campaign_setting\x18\x02 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.SmartCampaignSetting2\xfd\x04\n\x1bSmartCampaignSettingService\x12\x86\x02\n\x16GetSmartCampaignStatus\x12@.google.ads.googleads.v16.services.GetSmartCampaignStatusRequest\x1a\x41.google.ads.googleads.v16.services.GetSmartCampaignStatusResponse\"g\xda\x41\rresource_name\x82\xd3\xe4\x93\x02Q\x12O/v16/{resource_name=customers/*/smartCampaignSettings/*}:getSmartCampaignStatus\x12\x8d\x02\n\x1bMutateSmartCampaignSettings\x12\x45.google.ads.googleads.v16.services.MutateSmartCampaignSettingsRequest\x1a\x46.google.ads.googleads.v16.services.MutateSmartCampaignSettingsResponse\"_\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02@\";/v16/customers/{customer_id=*}/smartCampaignSettings:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8c\x02\n%com.google.ads.googleads.v16.servicesB SmartCampaignSettingServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.resources.SmartCampaignSetting", "google/ads/googleads/v16/resources/smart_campaign_setting.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + GetSmartCampaignStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GetSmartCampaignStatusRequest").msgclass + SmartCampaignNotEligibleDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignNotEligibleDetails").msgclass + SmartCampaignEligibleDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignEligibleDetails").msgclass + SmartCampaignPausedDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignPausedDetails").msgclass + SmartCampaignRemovedDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignRemovedDetails").msgclass + SmartCampaignEndedDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignEndedDetails").msgclass + GetSmartCampaignStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.GetSmartCampaignStatusResponse").msgclass + MutateSmartCampaignSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSmartCampaignSettingsRequest").msgclass + SmartCampaignSettingOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignSettingOperation").msgclass + MutateSmartCampaignSettingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSmartCampaignSettingsResponse").msgclass + MutateSmartCampaignSettingResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateSmartCampaignSettingResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service_services_pb.rb new file mode 100644 index 000000000..302780b2e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_setting_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/smart_campaign_setting_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/smart_campaign_setting_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SmartCampaignSettingService + # Proto file describing the Smart campaign setting service. + # + # Service to manage Smart campaign settings. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.SmartCampaignSettingService' + + # Returns the status of the requested Smart campaign. + rpc :GetSmartCampaignStatus, ::Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusRequest, ::Google::Ads::GoogleAds::V16::Services::GetSmartCampaignStatusResponse + # Updates Smart campaign settings for campaigns. + rpc :MutateSmartCampaignSettings, ::Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateSmartCampaignSettingsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service.rb new file mode 100644 index 000000000..b3191d1b4 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/smart_campaign_suggest_service/credentials" +require "google/ads/google_ads/v16/services/smart_campaign_suggest_service/paths" +require "google/ads/google_ads/v16/services/smart_campaign_suggest_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to get suggestions for Smart Campaigns. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/smart_campaign_suggest_service" + # client = ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.new + # + module SmartCampaignSuggestService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "smart_campaign_suggest_service", "helpers.rb" +require "google/ads/google_ads/v16/services/smart_campaign_suggest_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/client.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/client.rb new file mode 100644 index 000000000..bc2f83674 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/client.rb @@ -0,0 +1,633 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/smart_campaign_suggest_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SmartCampaignSuggestService + ## + # Client for the SmartCampaignSuggestService service. + # + # Service to get suggestions for Smart Campaigns. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :smart_campaign_suggest_service_stub + + ## + # Configure the SmartCampaignSuggestService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SmartCampaignSuggestService clients + # ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SmartCampaignSuggestService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @smart_campaign_suggest_service_stub.universe_domain + end + + ## + # Create a new SmartCampaignSuggestService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SmartCampaignSuggestService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/smart_campaign_suggest_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @smart_campaign_suggest_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns BudgetOption suggestions. + # + # @overload suggest_smart_campaign_budget_options(request, options = nil) + # Pass arguments to `suggest_smart_campaign_budget_options` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_smart_campaign_budget_options(customer_id: nil, campaign: nil, suggestion_info: nil) + # Pass arguments to `suggest_smart_campaign_budget_options` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose budget options are to be suggested. + # @param campaign [::String] + # Required. The resource name of the campaign to get suggestion for. + # @param suggestion_info [::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestionInfo, ::Hash] + # Required. Information needed to get budget options + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsRequest.new + # + # # Call the suggest_smart_campaign_budget_options method. + # result = client.suggest_smart_campaign_budget_options request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsResponse. + # p result + # + def suggest_smart_campaign_budget_options request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_smart_campaign_budget_options.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.suggest_smart_campaign_budget_options.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_smart_campaign_budget_options.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @smart_campaign_suggest_service_stub.call_rpc :suggest_smart_campaign_budget_options, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Suggests a Smart campaign ad compatible with the Ad family of resources, + # based on data points such as targeting and the business to advertise. + # + # @overload suggest_smart_campaign_ad(request, options = nil) + # Pass arguments to `suggest_smart_campaign_ad` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_smart_campaign_ad(customer_id: nil, suggestion_info: nil) + # Pass arguments to `suggest_smart_campaign_ad` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param suggestion_info [::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestionInfo, ::Hash] + # Required. Inputs used to suggest a Smart campaign ad. + # Required fields: final_url, language_code, keyword_themes. + # Optional but recommended fields to improve the quality of the suggestion: + # business_setting and geo_target. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdRequest.new + # + # # Call the suggest_smart_campaign_ad method. + # result = client.suggest_smart_campaign_ad request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdResponse. + # p result + # + def suggest_smart_campaign_ad request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_smart_campaign_ad.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.suggest_smart_campaign_ad.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_smart_campaign_ad.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @smart_campaign_suggest_service_stub.call_rpc :suggest_smart_campaign_ad, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Suggests keyword themes to advertise on. + # + # @overload suggest_keyword_themes(request, options = nil) + # Pass arguments to `suggest_keyword_themes` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_keyword_themes(customer_id: nil, suggestion_info: nil) + # Pass arguments to `suggest_keyword_themes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param suggestion_info [::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestionInfo, ::Hash] + # Required. Information to get keyword theme suggestions. + # Required fields: + # + # * suggestion_info.final_url + # * suggestion_info.language_code + # * suggestion_info.geo_target + # + # Recommended fields: + # + # * suggestion_info.business_setting + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesRequest.new + # + # # Call the suggest_keyword_themes method. + # result = client.suggest_keyword_themes request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesResponse. + # p result + # + def suggest_keyword_themes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_keyword_themes.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.suggest_keyword_themes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_keyword_themes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @smart_campaign_suggest_service_stub.call_rpc :suggest_keyword_themes, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the SmartCampaignSuggestService API. + # + # This class represents the configuration for SmartCampaignSuggestService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # suggest_smart_campaign_budget_options to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_smart_campaign_budget_options.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::SmartCampaignSuggestService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_smart_campaign_budget_options.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SmartCampaignSuggestService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `suggest_smart_campaign_budget_options` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_smart_campaign_budget_options + ## + # RPC-specific configuration for `suggest_smart_campaign_ad` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_smart_campaign_ad + ## + # RPC-specific configuration for `suggest_keyword_themes` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_keyword_themes + + # @private + def initialize parent_rpcs = nil + suggest_smart_campaign_budget_options_config = parent_rpcs.suggest_smart_campaign_budget_options if parent_rpcs.respond_to? :suggest_smart_campaign_budget_options + @suggest_smart_campaign_budget_options = ::Gapic::Config::Method.new suggest_smart_campaign_budget_options_config + suggest_smart_campaign_ad_config = parent_rpcs.suggest_smart_campaign_ad if parent_rpcs.respond_to? :suggest_smart_campaign_ad + @suggest_smart_campaign_ad = ::Gapic::Config::Method.new suggest_smart_campaign_ad_config + suggest_keyword_themes_config = parent_rpcs.suggest_keyword_themes if parent_rpcs.respond_to? :suggest_keyword_themes + @suggest_keyword_themes = ::Gapic::Config::Method.new suggest_keyword_themes_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/credentials.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/credentials.rb new file mode 100644 index 000000000..ab29e0bf3 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SmartCampaignSuggestService + # Credentials for the SmartCampaignSuggestService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/paths.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/paths.rb new file mode 100644 index 000000000..d6ef772e2 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SmartCampaignSuggestService + # Path helper methods for the SmartCampaignSuggestService API. + module Paths + ## + # Create a fully-qualified Campaign resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/campaigns/{campaign_id}` + # + # @param customer_id [String] + # @param campaign_id [String] + # + # @return [::String] + def campaign_path customer_id:, campaign_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/campaigns/#{campaign_id}" + end + + ## + # Create a fully-qualified KeywordThemeConstant resource string. + # + # The resource will be in the following format: + # + # `keywordThemeConstants/{express_category_id}~{express_sub_category_id}` + # + # @param express_category_id [String] + # @param express_sub_category_id [String] + # + # @return [::String] + def keyword_theme_constant_path express_category_id:, express_sub_category_id: + raise ::ArgumentError, "express_category_id cannot contain /" if express_category_id.to_s.include? "/" + + "keywordThemeConstants/#{express_category_id}~#{express_sub_category_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service_pb.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service_pb.rb new file mode 100644 index 000000000..79302973c --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service_pb.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/smart_campaign_suggest_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/ad_type_infos_pb' +require 'google/ads/google_ads/v16/common/criteria_pb' +require 'google/ads/google_ads/v16/resources/keyword_theme_constant_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nFgoogle/ads/googleads/v16/services/smart_campaign_suggest_service.proto\x12!google.ads.googleads.v16.services\x1a\x33google/ads/googleads/v16/common/ad_type_infos.proto\x1a.google/ads/googleads/v16/common/criteria.proto\x1a?google/ads/googleads/v16/resources/keyword_theme_constant.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf6\x01\n(SuggestSmartCampaignBudgetOptionsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x08\x63\x61mpaign\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!googleads.googleapis.com/CampaignH\x00\x12^\n\x0fsuggestion_info\x18\x03 \x01(\x0b\x32>.google.ads.googleads.v16.services.SmartCampaignSuggestionInfoB\x03\xe0\x41\x02H\x00\x42\x11\n\x0fsuggestion_data\"\xe5\x05\n\x1bSmartCampaignSuggestionInfo\x12\x16\n\tfinal_url\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12J\n\x0c\x61\x64_schedules\x18\x06 \x03(\x0b\x32/.google.ads.googleads.v16.common.AdScheduleInfoB\x03\xe0\x41\x01\x12N\n\x0ekeyword_themes\x18\x07 \x03(\x0b\x32\x31.google.ads.googleads.v16.common.KeywordThemeInfoB\x03\xe0\x41\x01\x12o\n\x10\x62usiness_context\x18\x08 \x01(\x0b\x32N.google.ads.googleads.v16.services.SmartCampaignSuggestionInfo.BusinessContextB\x03\xe0\x41\x01H\x00\x12(\n\x19\x62usiness_profile_location\x18\t \x01(\tB\x03\xe0\x41\x01H\x00\x12i\n\rlocation_list\x18\x04 \x01(\x0b\x32K.google.ads.googleads.v16.services.SmartCampaignSuggestionInfo.LocationListB\x03\xe0\x41\x01H\x01\x12H\n\tproximity\x18\x05 \x01(\x0b\x32..google.ads.googleads.v16.common.ProximityInfoB\x03\xe0\x41\x01H\x01\x1aU\n\x0cLocationList\x12\x45\n\tlocations\x18\x01 \x03(\x0b\x32-.google.ads.googleads.v16.common.LocationInfoB\x03\xe0\x41\x02\x1a-\n\x0f\x42usinessContext\x12\x1a\n\rbusiness_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x42\x12\n\x10\x62usiness_settingB\x0c\n\ngeo_target\"\xff\x04\n)SuggestSmartCampaignBudgetOptionsResponse\x12p\n\x03low\x18\x01 \x01(\x0b\x32Y.google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsResponse.BudgetOptionB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12x\n\x0brecommended\x18\x02 \x01(\x0b\x32Y.google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsResponse.BudgetOptionB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12q\n\x04high\x18\x03 \x01(\x0b\x32Y.google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsResponse.BudgetOptionB\x03\xe0\x41\x01H\x02\x88\x01\x01\x1a=\n\x07Metrics\x12\x18\n\x10min_daily_clicks\x18\x01 \x01(\x03\x12\x18\n\x10max_daily_clicks\x18\x02 \x01(\x03\x1a\x92\x01\n\x0c\x42udgetOption\x12\x1b\n\x13\x64\x61ily_amount_micros\x18\x01 \x01(\x03\x12\x65\n\x07metrics\x18\x02 \x01(\x0b\x32T.google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsResponse.MetricsB\x06\n\x04_lowB\x0e\n\x0c_recommendedB\x07\n\x05_high\"\x97\x01\n\x1dSuggestSmartCampaignAdRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\\\n\x0fsuggestion_info\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.services.SmartCampaignSuggestionInfoB\x03\xe0\x41\x02\"l\n\x1eSuggestSmartCampaignAdResponse\x12J\n\x07\x61\x64_info\x18\x01 \x01(\x0b\x32\x34.google.ads.googleads.v16.common.SmartCampaignAdInfoB\x03\xe0\x41\x01\"\x95\x01\n\x1bSuggestKeywordThemesRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\\\n\x0fsuggestion_info\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.services.SmartCampaignSuggestionInfoB\x03\xe0\x41\x02\"\xa5\x02\n\x1cSuggestKeywordThemesResponse\x12\x64\n\x0ekeyword_themes\x18\x02 \x03(\x0b\x32L.google.ads.googleads.v16.services.SuggestKeywordThemesResponse.KeywordTheme\x1a\x9e\x01\n\x0cKeywordTheme\x12Z\n\x16keyword_theme_constant\x18\x01 \x01(\x0b\x32\x38.google.ads.googleads.v16.resources.KeywordThemeConstantH\x00\x12!\n\x17\x66ree_form_keyword_theme\x18\x02 \x01(\tH\x00\x42\x0f\n\rkeyword_theme2\xae\x06\n\x1bSmartCampaignSuggestService\x12\x8b\x02\n!SuggestSmartCampaignBudgetOptions\x12K.google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsRequest\x1aL.google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsResponse\"K\x82\xd3\xe4\x93\x02\x45\"@/v16/customers/{customer_id=*}:suggestSmartCampaignBudgetOptions:\x01*\x12\xdf\x01\n\x16SuggestSmartCampaignAd\x12@.google.ads.googleads.v16.services.SuggestSmartCampaignAdRequest\x1a\x41.google.ads.googleads.v16.services.SuggestSmartCampaignAdResponse\"@\x82\xd3\xe4\x93\x02:\"5/v16/customers/{customer_id=*}:suggestSmartCampaignAd:\x01*\x12\xd7\x01\n\x14SuggestKeywordThemes\x12>.google.ads.googleads.v16.services.SuggestKeywordThemesRequest\x1a?.google.ads.googleads.v16.services.SuggestKeywordThemesResponse\">\x82\xd3\xe4\x93\x02\x38\"3/v16/customers/{customer_id=*}:suggestKeywordThemes:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8c\x02\n%com.google.ads.googleads.v16.servicesB SmartCampaignSuggestServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.AdScheduleInfo", "google/ads/googleads/v16/common/criteria.proto"], + ["google.ads.googleads.v16.common.SmartCampaignAdInfo", "google/ads/googleads/v16/common/ad_type_infos.proto"], + ["google.ads.googleads.v16.resources.KeywordThemeConstant", "google/ads/googleads/v16/resources/keyword_theme_constant.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + SuggestSmartCampaignBudgetOptionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsRequest").msgclass + SmartCampaignSuggestionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignSuggestionInfo").msgclass + SmartCampaignSuggestionInfo::LocationList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignSuggestionInfo.LocationList").msgclass + SmartCampaignSuggestionInfo::BusinessContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SmartCampaignSuggestionInfo.BusinessContext").msgclass + SuggestSmartCampaignBudgetOptionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsResponse").msgclass + SuggestSmartCampaignBudgetOptionsResponse::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsResponse.Metrics").msgclass + SuggestSmartCampaignBudgetOptionsResponse::BudgetOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestSmartCampaignBudgetOptionsResponse.BudgetOption").msgclass + SuggestSmartCampaignAdRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestSmartCampaignAdRequest").msgclass + SuggestSmartCampaignAdResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestSmartCampaignAdResponse").msgclass + SuggestKeywordThemesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestKeywordThemesRequest").msgclass + SuggestKeywordThemesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestKeywordThemesResponse").msgclass + SuggestKeywordThemesResponse::KeywordTheme = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestKeywordThemesResponse.KeywordTheme").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service_services_pb.rb new file mode 100644 index 000000000..6a0a61693 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/smart_campaign_suggest_service_services_pb.rb @@ -0,0 +1,52 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/smart_campaign_suggest_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/smart_campaign_suggest_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module SmartCampaignSuggestService + # Service to get suggestions for Smart Campaigns. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.SmartCampaignSuggestService' + + # Returns BudgetOption suggestions. + rpc :SuggestSmartCampaignBudgetOptions, ::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsRequest, ::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignBudgetOptionsResponse + # Suggests a Smart campaign ad compatible with the Ad family of resources, + # based on data points such as targeting and the business to advertise. + rpc :SuggestSmartCampaignAd, ::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdRequest, ::Google::Ads::GoogleAds::V16::Services::SuggestSmartCampaignAdResponse + # Suggests keyword themes to advertise on. + rpc :SuggestKeywordThemes, ::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesRequest, ::Google::Ads::GoogleAds::V16::Services::SuggestKeywordThemesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service.rb b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service.rb new file mode 100644 index 000000000..9e6fe450f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/third_party_app_analytics_link_service/credentials" +require "google/ads/google_ads/v16/services/third_party_app_analytics_link_service/paths" +require "google/ads/google_ads/v16/services/third_party_app_analytics_link_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # This service allows management of links between Google Ads and third party + # app analytics. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/third_party_app_analytics_link_service" + # client = ::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client.new + # + module ThirdPartyAppAnalyticsLinkService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "third_party_app_analytics_link_service", "helpers.rb" +require "google/ads/google_ads/v16/services/third_party_app_analytics_link_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/client.rb b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/client.rb new file mode 100644 index 000000000..6697d760b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/client.rb @@ -0,0 +1,434 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/third_party_app_analytics_link_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ThirdPartyAppAnalyticsLinkService + ## + # Client for the ThirdPartyAppAnalyticsLinkService service. + # + # This service allows management of links between Google Ads and third party + # app analytics. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :third_party_app_analytics_link_service_stub + + ## + # Configure the ThirdPartyAppAnalyticsLinkService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ThirdPartyAppAnalyticsLinkService clients + # ::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ThirdPartyAppAnalyticsLinkService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @third_party_app_analytics_link_service_stub.universe_domain + end + + ## + # Create a new ThirdPartyAppAnalyticsLinkService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ThirdPartyAppAnalyticsLinkService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/third_party_app_analytics_link_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @third_party_app_analytics_link_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Regenerate ThirdPartyAppAnalyticsLink.shareable_link_id that should be + # provided to the third party when setting up app analytics. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + # + # @overload regenerate_shareable_link_id(request, options = nil) + # Pass arguments to `regenerate_shareable_link_id` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload regenerate_shareable_link_id(resource_name: nil) + # Pass arguments to `regenerate_shareable_link_id` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_name [::String] + # Resource name of the third party app analytics link. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdRequest.new + # + # # Call the regenerate_shareable_link_id method. + # result = client.regenerate_shareable_link_id request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdResponse. + # p result + # + def regenerate_shareable_link_id request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.regenerate_shareable_link_id.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_name + header_params["resource_name"] = request.resource_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.regenerate_shareable_link_id.timeout, + metadata: metadata, + retry_policy: @config.rpcs.regenerate_shareable_link_id.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @third_party_app_analytics_link_service_stub.call_rpc :regenerate_shareable_link_id, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the ThirdPartyAppAnalyticsLinkService API. + # + # This class represents the configuration for ThirdPartyAppAnalyticsLinkService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # regenerate_shareable_link_id to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.regenerate_shareable_link_id.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::ThirdPartyAppAnalyticsLinkService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.regenerate_shareable_link_id.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ThirdPartyAppAnalyticsLinkService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `regenerate_shareable_link_id` + # @return [::Gapic::Config::Method] + # + attr_reader :regenerate_shareable_link_id + + # @private + def initialize parent_rpcs = nil + regenerate_shareable_link_id_config = parent_rpcs.regenerate_shareable_link_id if parent_rpcs.respond_to? :regenerate_shareable_link_id + @regenerate_shareable_link_id = ::Gapic::Config::Method.new regenerate_shareable_link_id_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/credentials.rb b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/credentials.rb new file mode 100644 index 000000000..7d3c0048a --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ThirdPartyAppAnalyticsLinkService + # Credentials for the ThirdPartyAppAnalyticsLinkService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/paths.rb b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/paths.rb new file mode 100644 index 000000000..cd1a48c53 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ThirdPartyAppAnalyticsLinkService + # Path helper methods for the ThirdPartyAppAnalyticsLinkService API. + module Paths + ## + # Create a fully-qualified ThirdPartyAppAnalyticsLink resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/thirdPartyAppAnalyticsLinks/{customer_link_id}` + # + # @param customer_id [String] + # @param customer_link_id [String] + # + # @return [::String] + def third_party_app_analytics_link_path customer_id:, customer_link_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/thirdPartyAppAnalyticsLinks/#{customer_link_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service_pb.rb b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service_pb.rb new file mode 100644 index 000000000..a15c7850f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/third_party_app_analytics_link_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\nNgoogle/ads/googleads/v16/services/third_party_app_analytics_link_service.proto\x12!google.ads.googleads.v16.services\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x19google/api/resource.proto\"s\n RegenerateShareableLinkIdRequest\x12O\n\rresource_name\x18\x01 \x01(\tB8\xfa\x41\x35\n3googleads.googleapis.com/ThirdPartyAppAnalyticsLink\"#\n!RegenerateShareableLinkIdResponse2\xf8\x02\n!ThirdPartyAppAnalyticsLinkService\x12\x8b\x02\n\x19RegenerateShareableLinkId\x12\x43.google.ads.googleads.v16.services.RegenerateShareableLinkIdRequest\x1a\x44.google.ads.googleads.v16.services.RegenerateShareableLinkIdResponse\"c\x82\xd3\xe4\x93\x02]\"X/v16/{resource_name=customers/*/thirdPartyAppAnalyticsLinks/*}:regenerateShareableLinkId:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x92\x02\n%com.google.ads.googleads.v16.servicesB&ThirdPartyAppAnalyticsLinkServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + RegenerateShareableLinkIdRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.RegenerateShareableLinkIdRequest").msgclass + RegenerateShareableLinkIdResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.RegenerateShareableLinkIdResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service_services_pb.rb new file mode 100644 index 000000000..1af67ed52 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/third_party_app_analytics_link_service_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/third_party_app_analytics_link_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/third_party_app_analytics_link_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module ThirdPartyAppAnalyticsLinkService + # This service allows management of links between Google Ads and third party + # app analytics. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.ThirdPartyAppAnalyticsLinkService' + + # Regenerate ThirdPartyAppAnalyticsLink.shareable_link_id that should be + # provided to the third party when setting up app analytics. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [HeaderError]() + # [InternalError]() + # [QuotaError]() + # [RequestError]() + rpc :RegenerateShareableLinkId, ::Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdRequest, ::Google::Ads::GoogleAds::V16::Services::RegenerateShareableLinkIdResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service.rb b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service.rb new file mode 100644 index 000000000..8754efd1b --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/travel_asset_suggestion_service/credentials" +require "google/ads/google_ads/v16/services/travel_asset_suggestion_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to retrieve Travel asset suggestions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/travel_asset_suggestion_service" + # client = ::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client.new + # + module TravelAssetSuggestionService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "travel_asset_suggestion_service", "helpers.rb" +require "google/ads/google_ads/v16/services/travel_asset_suggestion_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service/client.rb b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service/client.rb new file mode 100644 index 000000000..100fed527 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service/client.rb @@ -0,0 +1,433 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/travel_asset_suggestion_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module TravelAssetSuggestionService + ## + # Client for the TravelAssetSuggestionService service. + # + # Service to retrieve Travel asset suggestions. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :travel_asset_suggestion_service_stub + + ## + # Configure the TravelAssetSuggestionService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TravelAssetSuggestionService clients + # ::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TravelAssetSuggestionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @travel_asset_suggestion_service_stub.universe_domain + end + + ## + # Create a new TravelAssetSuggestionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TravelAssetSuggestionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/travel_asset_suggestion_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @travel_asset_suggestion_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Returns Travel Asset suggestions. Asset + # suggestions are returned on a best-effort basis. There are no guarantees + # that all possible asset types will be returned for any given hotel + # property. + # + # @overload suggest_travel_assets(request, options = nil) + # Pass arguments to `suggest_travel_assets` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_travel_assets(customer_id: nil, language_option: nil, place_ids: nil) + # Pass arguments to `suggest_travel_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer. + # @param language_option [::String] + # Required. The language specifications in BCP 47 format (for example, en-US, + # zh-CN, etc.) for the asset suggestions. Text will be in this language. + # Usually matches one of the campaign target languages. + # @param place_ids [::Array<::String>] + # The Google Maps Place IDs of hotels for which assets are requested. See + # https://developers.google.com/places/web-service/place-id for more + # information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsRequest.new + # + # # Call the suggest_travel_assets method. + # result = client.suggest_travel_assets request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsResponse. + # p result + # + def suggest_travel_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_travel_assets.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.suggest_travel_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_travel_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @travel_asset_suggestion_service_stub.call_rpc :suggest_travel_assets, request, + options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the TravelAssetSuggestionService API. + # + # This class represents the configuration for TravelAssetSuggestionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # suggest_travel_assets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_travel_assets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::TravelAssetSuggestionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.suggest_travel_assets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the TravelAssetSuggestionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `suggest_travel_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_travel_assets + + # @private + def initialize parent_rpcs = nil + suggest_travel_assets_config = parent_rpcs.suggest_travel_assets if parent_rpcs.respond_to? :suggest_travel_assets + @suggest_travel_assets = ::Gapic::Config::Method.new suggest_travel_assets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service/credentials.rb b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service/credentials.rb new file mode 100644 index 000000000..5f2aadcb7 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module TravelAssetSuggestionService + # Credentials for the TravelAssetSuggestionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service_pb.rb b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service_pb.rb new file mode 100644 index 000000000..c53a05703 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/travel_asset_suggestion_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/enums/asset_field_type_pb' +require 'google/ads/google_ads/v16/enums/call_to_action_type_pb' +require 'google/ads/google_ads/v16/enums/hotel_asset_suggestion_status_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\nGgoogle/ads/googleads/v16/services/travel_asset_suggestion_service.proto\x12!google.ads.googleads.v16.services\x1a\x35google/ads/googleads/v16/enums/asset_field_type.proto\x1a\x38google/ads/googleads/v16/enums/call_to_action_type.proto\x1a\x42google/ads/googleads/v16/enums/hotel_asset_suggestion_status.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"g\n\x1aSuggestTravelAssetsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0flanguage_option\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tplace_ids\x18\x04 \x03(\t\"w\n\x1bSuggestTravelAssetsResponse\x12X\n\x17hotel_asset_suggestions\x18\x01 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.HotelAssetSuggestion\"\xab\x03\n\x14HotelAssetSuggestion\x12\x10\n\x08place_id\x18\x01 \x01(\t\x12\x11\n\tfinal_url\x18\x02 \x01(\t\x12\x12\n\nhotel_name\x18\x03 \x01(\t\x12]\n\x0e\x63\x61ll_to_action\x18\x04 \x01(\x0e\x32\x45.google.ads.googleads.v16.enums.CallToActionTypeEnum.CallToActionType\x12\x46\n\x0btext_assets\x18\x05 \x03(\x0b\x32\x31.google.ads.googleads.v16.services.HotelTextAsset\x12H\n\x0cimage_assets\x18\x06 \x03(\x0b\x32\x32.google.ads.googleads.v16.services.HotelImageAsset\x12i\n\x06status\x18\x07 \x01(\x0e\x32Y.google.ads.googleads.v16.enums.HotelAssetSuggestionStatusEnum.HotelAssetSuggestionStatus\"{\n\x0eHotelTextAsset\x12\x0c\n\x04text\x18\x01 \x01(\t\x12[\n\x10\x61sset_field_type\x18\x02 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetFieldTypeEnum.AssetFieldType\"{\n\x0fHotelImageAsset\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12[\n\x10\x61sset_field_type\x18\x02 \x01(\x0e\x32\x41.google.ads.googleads.v16.enums.AssetFieldTypeEnum.AssetFieldType2\xd9\x02\n\x1cTravelAssetSuggestionService\x12\xf1\x01\n\x13SuggestTravelAssets\x12=.google.ads.googleads.v16.services.SuggestTravelAssetsRequest\x1a>.google.ads.googleads.v16.services.SuggestTravelAssetsResponse\"[\xda\x41\x1b\x63ustomer_id,language_option\x82\xd3\xe4\x93\x02\x37\"2/v16/customers/{customer_id=*}:suggestTravelAssets:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x8d\x02\n%com.google.ads.googleads.v16.servicesB!TravelAssetSuggestionServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + SuggestTravelAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestTravelAssetsRequest").msgclass + SuggestTravelAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.SuggestTravelAssetsResponse").msgclass + HotelAssetSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.HotelAssetSuggestion").msgclass + HotelTextAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.HotelTextAsset").msgclass + HotelImageAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.HotelImageAsset").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service_services_pb.rb new file mode 100644 index 000000000..74b989662 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/travel_asset_suggestion_service_services_pb.rb @@ -0,0 +1,50 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/travel_asset_suggestion_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/travel_asset_suggestion_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module TravelAssetSuggestionService + # Service to retrieve Travel asset suggestions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.TravelAssetSuggestionService' + + # Returns Travel Asset suggestions. Asset + # suggestions are returned on a best-effort basis. There are no guarantees + # that all possible asset types will be returned for any given hotel + # property. + rpc :SuggestTravelAssets, ::Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsRequest, ::Google::Ads::GoogleAds::V16::Services::SuggestTravelAssetsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_data_service.rb b/lib/google/ads/google_ads/v16/services/user_data_service.rb new file mode 100644 index 000000000..a6523b58f --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_data_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/user_data_service/credentials" +require "google/ads/google_ads/v16/services/user_data_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage user data uploads. + # Any uploads made to a Customer Match list through this service will be + # eligible for matching as per the customer matching process. See + # https://support.google.com/google-ads/answer/7474263. However, the uploads + # made through this service will not be visible under the 'Segment members' + # section for the Customer Match List in the Google Ads UI. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/user_data_service" + # client = ::Google::Ads::GoogleAds::V16::Services::UserDataService::Client.new + # + module UserDataService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "user_data_service", "helpers.rb" +require "google/ads/google_ads/v16/services/user_data_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/user_data_service/client.rb b/lib/google/ads/google_ads/v16/services/user_data_service/client.rb new file mode 100644 index 000000000..c63a64e73 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_data_service/client.rb @@ -0,0 +1,443 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/user_data_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module UserDataService + ## + # Client for the UserDataService service. + # + # Service to manage user data uploads. + # Any uploads made to a Customer Match list through this service will be + # eligible for matching as per the customer matching process. See + # https://support.google.com/google-ads/answer/7474263. However, the uploads + # made through this service will not be visible under the 'Segment members' + # section for the Customer Match List in the Google Ads UI. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :user_data_service_stub + + ## + # Configure the UserDataService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::UserDataService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserDataService clients + # ::Google::Ads::GoogleAds::V16::Services::UserDataService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the UserDataService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::UserDataService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @user_data_service_stub.universe_domain + end + + ## + # Create a new UserDataService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::UserDataService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::UserDataService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the UserDataService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/user_data_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @user_data_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::UserDataService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Uploads the given user data. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [OfflineUserDataJobError]() + # [QuotaError]() + # [RequestError]() + # [UserDataError]() + # + # @overload upload_user_data(request, options = nil) + # Pass arguments to `upload_user_data` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::UploadUserDataRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::UploadUserDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upload_user_data(customer_id: nil, operations: nil, customer_match_user_list_metadata: nil) + # Pass arguments to `upload_user_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer for which to update the user data. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::UserDataOperation, ::Hash>] + # Required. The list of operations to be done. + # @param customer_match_user_list_metadata [::Google::Ads::GoogleAds::V16::Common::CustomerMatchUserListMetadata, ::Hash] + # Metadata for data updates to a Customer Match user list. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::UploadUserDataResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::UploadUserDataResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::UserDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::UploadUserDataRequest.new + # + # # Call the upload_user_data method. + # result = client.upload_user_data request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::UploadUserDataResponse. + # p result + # + def upload_user_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::UploadUserDataRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.upload_user_data.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.upload_user_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_user_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_data_service_stub.call_rpc :upload_user_data, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the UserDataService API. + # + # This class represents the configuration for UserDataService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::UserDataService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # upload_user_data to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::UserDataService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.upload_user_data.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::UserDataService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.upload_user_data.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the UserDataService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `upload_user_data` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_user_data + + # @private + def initialize parent_rpcs = nil + upload_user_data_config = parent_rpcs.upload_user_data if parent_rpcs.respond_to? :upload_user_data + @upload_user_data = ::Gapic::Config::Method.new upload_user_data_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_data_service/credentials.rb b/lib/google/ads/google_ads/v16/services/user_data_service/credentials.rb new file mode 100644 index 000000000..4a550919e --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_data_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module UserDataService + # Credentials for the UserDataService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_data_service_pb.rb b/lib/google/ads/google_ads/v16/services/user_data_service_pb.rb new file mode 100644 index 000000000..9a2107970 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_data_service_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/user_data_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/common/offline_user_data_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/services/user_data_service.proto\x12!google.ads.googleads.v16.services\x1a\x37google/ads/googleads/v16/common/offline_user_data.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"\xf9\x01\n\x15UploadUserDataRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12M\n\noperations\x18\x03 \x03(\x0b\x32\x34.google.ads.googleads.v16.services.UserDataOperationB\x03\xe0\x41\x02\x12k\n!customer_match_user_list_metadata\x18\x02 \x01(\x0b\x32>.google.ads.googleads.v16.common.CustomerMatchUserListMetadataH\x00\x42\n\n\x08metadata\"\x9a\x01\n\x11UserDataOperation\x12;\n\x06\x63reate\x18\x01 \x01(\x0b\x32).google.ads.googleads.v16.common.UserDataH\x00\x12;\n\x06remove\x18\x02 \x01(\x0b\x32).google.ads.googleads.v16.common.UserDataH\x00\x42\x0b\n\toperation\"\x92\x01\n\x16UploadUserDataResponse\x12\x1d\n\x10upload_date_time\x18\x03 \x01(\tH\x00\x88\x01\x01\x12&\n\x19received_operations_count\x18\x04 \x01(\x05H\x01\x88\x01\x01\x42\x13\n\x11_upload_date_timeB\x1c\n\x1a_received_operations_count2\x9a\x02\n\x0fUserDataService\x12\xbf\x01\n\x0eUploadUserData\x12\x38.google.ads.googleads.v16.services.UploadUserDataRequest\x1a\x39.google.ads.googleads.v16.services.UploadUserDataResponse\"8\x82\xd3\xe4\x93\x02\x32\"-/v16/customers/{customer_id=*}:uploadUserData:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x80\x02\n%com.google.ads.googleads.v16.servicesB\x14UserDataServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.ads.googleads.v16.common.CustomerMatchUserListMetadata", "google/ads/googleads/v16/common/offline_user_data.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + UploadUserDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UploadUserDataRequest").msgclass + UserDataOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UserDataOperation").msgclass + UploadUserDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UploadUserDataResponse").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_data_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/user_data_service_services_pb.rb new file mode 100644 index 000000000..39f4f8c16 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_data_service_services_pb.rb @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/user_data_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/user_data_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module UserDataService + # Proto file describing the UserDataService. + # + # Service to manage user data uploads. + # Any uploads made to a Customer Match list through this service will be + # eligible for matching as per the customer matching process. See + # https://support.google.com/google-ads/answer/7474263. However, the uploads + # made through this service will not be visible under the 'Segment members' + # section for the Customer Match List in the Google Ads UI. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.UserDataService' + + # Uploads the given user data. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [FieldError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [OfflineUserDataJobError]() + # [QuotaError]() + # [RequestError]() + # [UserDataError]() + rpc :UploadUserData, ::Google::Ads::GoogleAds::V16::Services::UploadUserDataRequest, ::Google::Ads::GoogleAds::V16::Services::UploadUserDataResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_list_service.rb b/lib/google/ads/google_ads/v16/services/user_list_service.rb new file mode 100644 index 000000000..c45e58542 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_list_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/ads/google_ads/version" + +require "google/ads/google_ads/v16/services/user_list_service/credentials" +require "google/ads/google_ads/v16/services/user_list_service/paths" +require "google/ads/google_ads/v16/services/user_list_service/client" + +module Google + module Ads + module GoogleAds + module V16 + module Services + ## + # Service to manage user lists. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/ads/google_ads/v16/services/user_list_service" + # client = ::Google::Ads::GoogleAds::V16::Services::UserListService::Client.new + # + module UserListService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "user_list_service", "helpers.rb" +require "google/ads/google_ads/v16/services/user_list_service/helpers" if ::File.file? helper_path diff --git a/lib/google/ads/google_ads/v16/services/user_list_service/client.rb b/lib/google/ads/google_ads/v16/services/user_list_service/client.rb new file mode 100644 index 000000000..f03bd8398 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_list_service/client.rb @@ -0,0 +1,455 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# require "google/ads/google_ads/error" +require "google/ads/google_ads/v16/services/user_list_service_pb" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module UserListService + ## + # Client for the UserListService service. + # + # Service to manage user lists. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "googleads.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_list_service_stub + + ## + # Configure the UserListService Client class. + # + # See {::Google::Ads::GoogleAds::V16::Services::UserListService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserListService clients + # ::Google::Ads::GoogleAds::V16::Services::UserListService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + default_config = Client::Configuration.new + + default_config.timeout = 14_400.0 + default_config.retry_policy = { + initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the UserListService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Ads::GoogleAds::V16::Services::UserListService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @user_list_service_stub.universe_domain + end + + ## + # Create a new UserListService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Ads::GoogleAds::V16::Services::UserListService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Ads::GoogleAds::V16::Services::UserListService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the UserListService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 "gapic/grpc" + require "google/ads/google_ads/v16/services/user_list_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @user_list_service_stub = ::Gapic::ServiceStub.new( + ::Google::Ads::GoogleAds::V16::Services::UserListService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates or updates user lists. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotAllowlistedError]() + # [NotEmptyError]() + # [OperationAccessDeniedError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [StringFormatError]() + # [StringLengthError]() + # [UserListError]() + # + # @overload mutate_user_lists(request, options = nil) + # Pass arguments to `mutate_user_lists` via a request object, either of type + # {::Google::Ads::GoogleAds::V16::Services::MutateUserListsRequest} or an equivalent Hash. + # + # @param request [::Google::Ads::GoogleAds::V16::Services::MutateUserListsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mutate_user_lists(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil) + # Pass arguments to `mutate_user_lists` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param customer_id [::String] + # Required. The ID of the customer whose user lists are being modified. + # @param operations [::Array<::Google::Ads::GoogleAds::V16::Services::UserListOperation, ::Hash>] + # Required. The list of operations to perform on individual user lists. + # @param partial_failure [::Boolean] + # If true, successful operations will be carried out and invalid + # operations will return errors. If false, all operations will be carried + # out in one transaction if and only if they are all valid. + # Default is false. + # @param validate_only [::Boolean] + # If true, the request is validated but not executed. Only errors are + # returned, not results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Ads::GoogleAds::V16::Services::MutateUserListsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Ads::GoogleAds::V16::Services::MutateUserListsResponse] + # + # @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/ads/google_ads/v16/services" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Ads::GoogleAds::V16::Services::UserListService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Ads::GoogleAds::V16::Services::MutateUserListsRequest.new + # + # # Call the mutate_user_lists method. + # result = client.mutate_user_lists request + # + # # The returned object is of type Google::Ads::GoogleAds::V16::Services::MutateUserListsResponse. + # p result + # + def mutate_user_lists request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, + to: ::Google::Ads::GoogleAds::V16::Services::MutateUserListsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mutate_user_lists.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Ads::GoogleAds::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.customer_id + header_params["customer_id"] = request.customer_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mutate_user_lists.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_user_lists.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_list_service_stub.call_rpc :mutate_user_lists, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + # rescue GRPC::BadStatus => grpc_error + # raise Google::Ads::GoogleAds::Error.new grpc_error.message + end + + ## + # Configuration class for the UserListService API. + # + # This class represents the configuration for UserListService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Ads::GoogleAds::V16::Services::UserListService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # mutate_user_lists to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Ads::GoogleAds::V16::Services::UserListService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_user_lists.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Ads::GoogleAds::V16::Services::UserListService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.mutate_user_lists.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "googleads.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, + nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the UserListService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `mutate_user_lists` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_user_lists + + # @private + def initialize parent_rpcs = nil + mutate_user_lists_config = parent_rpcs.mutate_user_lists if parent_rpcs.respond_to? :mutate_user_lists + @mutate_user_lists = ::Gapic::Config::Method.new mutate_user_lists_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_list_service/credentials.rb b/lib/google/ads/google_ads/v16/services/user_list_service/credentials.rb new file mode 100644 index 000000000..56da601ba --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_list_service/credentials.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Ads + module GoogleAds + module V16 + module Services + module UserListService + # Credentials for the UserListService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/adwords" + ] + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_list_service/paths.rb b/lib/google/ads/google_ads/v16/services/user_list_service/paths.rb new file mode 100644 index 000000000..91a469922 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_list_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Ads + module GoogleAds + module V16 + module Services + module UserListService + # Path helper methods for the UserListService API. + module Paths + ## + # Create a fully-qualified UserList resource string. + # + # The resource will be in the following format: + # + # `customers/{customer_id}/userLists/{user_list_id}` + # + # @param customer_id [String] + # @param user_list_id [String] + # + # @return [::String] + def user_list_path customer_id:, user_list_id: + raise ::ArgumentError, "customer_id cannot contain /" if customer_id.to_s.include? "/" + + "customers/#{customer_id}/userLists/#{user_list_id}" + end + + extend self + end + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_list_service_pb.rb b/lib/google/ads/google_ads/v16/services/user_list_service_pb.rb new file mode 100644 index 000000000..5c9087c79 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_list_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v16/services/user_list_service.proto + +require 'google/protobuf' + +require 'google/ads/google_ads/v16/resources/user_list_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n9google/ads/googleads/v16/services/user_list_service.proto\x12!google.ads.googleads.v16.services\x1a\x32google/ads/googleads/v16/resources/user_list.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xb1\x01\n\x16MutateUserListsRequest\x12\x18\n\x0b\x63ustomer_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12M\n\noperations\x18\x02 \x03(\x0b\x32\x34.google.ads.googleads.v16.services.UserListOperationB\x03\xe0\x41\x02\x12\x17\n\x0fpartial_failure\x18\x03 \x01(\x08\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8b\x02\n\x11UserListOperation\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12>\n\x06\x63reate\x18\x01 \x01(\x0b\x32,.google.ads.googleads.v16.resources.UserListH\x00\x12>\n\x06update\x18\x02 \x01(\x0b\x32,.google.ads.googleads.v16.resources.UserListH\x00\x12\x38\n\x06remove\x18\x03 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/UserListH\x00\x42\x0b\n\toperation\"\x96\x01\n\x17MutateUserListsResponse\x12\x31\n\x15partial_failure_error\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12H\n\x07results\x18\x02 \x03(\x0b\x32\x37.google.ads.googleads.v16.services.MutateUserListResult\"U\n\x14MutateUserListResult\x12=\n\rresource_name\x18\x01 \x01(\tB&\xfa\x41#\n!googleads.googleapis.com/UserList2\xb8\x02\n\x0fUserListService\x12\xdd\x01\n\x0fMutateUserLists\x12\x39.google.ads.googleads.v16.services.MutateUserListsRequest\x1a:.google.ads.googleads.v16.services.MutateUserListsResponse\"S\xda\x41\x16\x63ustomer_id,operations\x82\xd3\xe4\x93\x02\x34\"//v16/customers/{customer_id=*}/userLists:mutate:\x01*\x1a\x45\xca\x41\x18googleads.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/adwordsB\x80\x02\n%com.google.ads.googleads.v16.servicesB\x14UserListServiceProtoP\x01ZIgoogle.golang.org/genproto/googleapis/ads/googleads/v16/services;services\xa2\x02\x03GAA\xaa\x02!Google.Ads.GoogleAds.V16.Services\xca\x02!Google\\Ads\\GoogleAds\\V16\\Services\xea\x02%Google::Ads::GoogleAds::V16::Servicesb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.ads.googleads.v16.resources.UserList", "google/ads/googleads/v16/resources/user_list.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Ads + module GoogleAds + module V16 + module Services + MutateUserListsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateUserListsRequest").msgclass + UserListOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.UserListOperation").msgclass + MutateUserListsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateUserListsResponse").msgclass + MutateUserListResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v16.services.MutateUserListResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/google_ads/v16/services/user_list_service_services_pb.rb b/lib/google/ads/google_ads/v16/services/user_list_service_services_pb.rb new file mode 100644 index 000000000..9aceb4f09 --- /dev/null +++ b/lib/google/ads/google_ads/v16/services/user_list_service_services_pb.rb @@ -0,0 +1,71 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v16/services/user_list_service.proto for package 'Google.Ads.GoogleAds.V16.Services' +# Original file comments: +# Copyright 2023 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 +# +# 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/google_ads/v16/services/user_list_service_pb' + +module Google + module Ads + module GoogleAds + module V16 + module Services + module UserListService + # Proto file describing the User List service. + # + # Service to manage user lists. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v16.services.UserListService' + + # Creates or updates user lists. Operation statuses are returned. + # + # List of thrown errors: + # [AuthenticationError]() + # [AuthorizationError]() + # [CollectionSizeError]() + # [DatabaseError]() + # [DistinctError]() + # [FieldError]() + # [FieldMaskError]() + # [HeaderError]() + # [InternalError]() + # [MutateError]() + # [NewResourceCreationError]() + # [NotAllowlistedError]() + # [NotEmptyError]() + # [OperationAccessDeniedError]() + # [QuotaError]() + # [RangeError]() + # [RequestError]() + # [StringFormatError]() + # [StringLengthError]() + # [UserListError]() + rpc :MutateUserLists, ::Google::Ads::GoogleAds::V16::Services::MutateUserListsRequest, ::Google::Ads::GoogleAds::V16::Services::MutateUserListsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/google_ads/version.rb b/lib/google/ads/google_ads/version.rb index 28136a233..2e90f0523 100644 --- a/lib/google/ads/google_ads/version.rb +++ b/lib/google/ads/google_ads/version.rb @@ -20,7 +20,7 @@ module Google module Ads module GoogleAds CLIENT_LIB_NAME = 'gccl'.freeze - CLIENT_LIB_VERSION = '26.0.0'.freeze + CLIENT_LIB_VERSION = '27.0.0'.freeze VERSION = CLIENT_LIB_VERSION end end diff --git a/test/test_errors.rb b/test/test_errors.rb index b897b5aa4..b85eb83e4 100644 --- a/test/test_errors.rb +++ b/test/test_errors.rb @@ -56,7 +56,7 @@ def test_code_version_validation def test_blank_code error = build_error - error.error_code = Google::Ads::GoogleAds::V15::Errors::ErrorCode.new + error.error_code = Google::Ads::GoogleAds::V16::Errors::ErrorCode.new error_code = Google::Ads::GoogleAds::Errors.code(error) assert_equal({}, error_code) @@ -71,16 +71,16 @@ def test_inspect end def build_error - Google::Ads::GoogleAds::V15::Errors::GoogleAdsError.new.tap do |error| - location = Google::Ads::GoogleAds::V15::Errors::ErrorLocation.new - path1 = Google::Ads::GoogleAds::V15::Errors::ErrorLocation::FieldPathElement.new + Google::Ads::GoogleAds::V16::Errors::GoogleAdsError.new.tap do |error| + location = Google::Ads::GoogleAds::V16::Errors::ErrorLocation.new + path1 = Google::Ads::GoogleAds::V16::Errors::ErrorLocation::FieldPathElement.new path1.field_name = 'operations' path1.index = 1 - path2 = Google::Ads::GoogleAds::V15::Errors::ErrorLocation::FieldPathElement.new + path2 = Google::Ads::GoogleAds::V16::Errors::ErrorLocation::FieldPathElement.new path2.field_name = 'create' - path3 = Google::Ads::GoogleAds::V15::Errors::ErrorLocation::FieldPathElement.new + path3 = Google::Ads::GoogleAds::V16::Errors::ErrorLocation::FieldPathElement.new path3.field_name = 'amount_micros' - error_code = Google::Ads::GoogleAds::V15::Errors::ErrorCode.new + error_code = Google::Ads::GoogleAds::V16::Errors::ErrorCode.new error_code.range_error = :TOO_LOW location.field_path_elements.push path1 location.field_path_elements.push path2 diff --git a/test/test_field_mask_util.rb b/test/test_field_mask_util.rb index 9ba760bba..5fafb0ec8 100644 --- a/test/test_field_mask_util.rb +++ b/test/test_field_mask_util.rb @@ -22,12 +22,12 @@ require 'google/protobuf/wrappers_pb' require 'google/ads/google_ads' require 'google/ads/google_ads/field_mask_util' -require 'google/ads/google_ads/v15/resources/campaign_pb' -require 'google/ads/google_ads/v15/resources/ad_pb' +require 'google/ads/google_ads/v16/resources/campaign_pb' +require 'google/ads/google_ads/v16/resources/ad_pb' class TestFieldMaskUtil < Minitest::Test def test_change_from_previous_value() - test_object = Google::Ads::GoogleAds::V15::Resources::Campaign.new + test_object = Google::Ads::GoogleAds::V16::Resources::Campaign.new test_object.name = 'test name' test_object.id = 1234 @@ -45,7 +45,7 @@ def test_change_from_client() # No setup. end - test_object = Google::Ads::GoogleAds::V15::Resources::Campaign.new + test_object = Google::Ads::GoogleAds::V16::Resources::Campaign.new test_object.name = 'test name' test_object.id = 1234 @@ -59,7 +59,7 @@ def test_change_from_client() end def test_change_from_no_value() - test_object = Google::Ads::GoogleAds::V15::Resources::Campaign.new + test_object = Google::Ads::GoogleAds::V16::Resources::Campaign.new mask = Google::Ads::GoogleAds::FieldMaskUtil.with test_object do test_object.name = 'new string' @@ -71,9 +71,9 @@ def test_change_from_no_value() end def test_change_to_null_value() - test_object = Google::Ads::GoogleAds::V15::Resources::Campaign.new + test_object = Google::Ads::GoogleAds::V16::Resources::Campaign.new - test_object.network_settings = Google::Ads::GoogleAds::V15::Resources::Campaign::NetworkSettings.new + test_object.network_settings = Google::Ads::GoogleAds::V16::Resources::Campaign::NetworkSettings.new mask = Google::Ads::GoogleAds::FieldMaskUtil.with test_object do test_object.network_settings = nil @@ -83,7 +83,7 @@ def test_change_to_null_value() end def test_no_change_to_value() - test_object = Google::Ads::GoogleAds::V15::Resources::Campaign.new + test_object = Google::Ads::GoogleAds::V16::Resources::Campaign.new test_name = 'test name' test_object.name = test_name @@ -96,7 +96,7 @@ def test_no_change_to_value() end def test_repeated_field_addition() - test_object = Google::Ads::GoogleAds::V15::Resources::Ad.new + test_object = Google::Ads::GoogleAds::V16::Resources::Ad.new test_object.final_urls << 'url 1' @@ -108,7 +108,7 @@ def test_repeated_field_addition() end def test_repeated_field_removal() - test_object = Google::Ads::GoogleAds::V15::Resources::Ad.new + test_object = Google::Ads::GoogleAds::V16::Resources::Ad.new test_object.final_urls << 'url 1' @@ -120,14 +120,14 @@ def test_repeated_field_removal() end def test_nested_field_changed() - test_object = Google::Ads::GoogleAds::V15::Resources::Ad.new + test_object = Google::Ads::GoogleAds::V16::Resources::Ad.new - text_ad = Google::Ads::GoogleAds::V15::Common::TextAdInfo.new + text_ad = Google::Ads::GoogleAds::V16::Common::TextAdInfo.new text_ad.headline = 'headline' test_object.text_ad = text_ad mask = Google::Ads::GoogleAds::FieldMaskUtil.with test_object do - new_text_ad = Google::Ads::GoogleAds::V15::Common::TextAdInfo.new + new_text_ad = Google::Ads::GoogleAds::V16::Common::TextAdInfo.new new_text_ad.headline = 'new headline' test_object.text_ad = new_text_ad end @@ -136,14 +136,14 @@ def test_nested_field_changed() end def test_nested_field_unchanged() - test_object = Google::Ads::GoogleAds::V15::Resources::Ad.new + test_object = Google::Ads::GoogleAds::V16::Resources::Ad.new - text_ad = Google::Ads::GoogleAds::V15::Common::TextAdInfo.new + text_ad = Google::Ads::GoogleAds::V16::Common::TextAdInfo.new text_ad.headline = 'headline' test_object.text_ad = text_ad mask = Google::Ads::GoogleAds::FieldMaskUtil.with test_object do - new_text_ad = Google::Ads::GoogleAds::V15::Common::TextAdInfo.new + new_text_ad = Google::Ads::GoogleAds::V16::Common::TextAdInfo.new new_text_ad.headline = 'headline' test_object.text_ad = new_text_ad end @@ -152,11 +152,11 @@ def test_nested_field_unchanged() end def test_nested_fields_for_update_from_nil() - test_object = Google::Ads::GoogleAds::V15::Resources::Campaign.new + test_object = Google::Ads::GoogleAds::V16::Resources::Campaign.new test_object.name = 'Name' nested_object = - Google::Ads::GoogleAds::V15::Resources::Campaign::NetworkSettings.new + Google::Ads::GoogleAds::V16::Resources::Campaign::NetworkSettings.new nested_object.target_search_network = true test_object.network_settings = nested_object @@ -169,13 +169,13 @@ def test_nested_fields_for_update_from_nil() end def test_nested_fields_for_update() - test_object = Google::Ads::GoogleAds::V15::Resources::Campaign.new + test_object = Google::Ads::GoogleAds::V16::Resources::Campaign.new mask = Google::Ads::GoogleAds::FieldMaskUtil.with test_object do test_object.name = 'Name' nested_object = - Google::Ads::GoogleAds::V15::Resources::Campaign::NetworkSettings.new + Google::Ads::GoogleAds::V16::Resources::Campaign::NetworkSettings.new nested_object.target_search_network = true test_object.network_settings = nested_object end @@ -187,10 +187,10 @@ def test_nested_fields_for_update() end def test_empty_top_level_field() - test_object = Google::Ads::GoogleAds::V15::Resources::Campaign.new + test_object = Google::Ads::GoogleAds::V16::Resources::Campaign.new mask = Google::Ads::GoogleAds::FieldMaskUtil.with test_object do - test_object.maximize_conversions = Google::Ads::GoogleAds::V15::Common::MaximizeConversions.new + test_object.maximize_conversions = Google::Ads::GoogleAds::V16::Common::MaximizeConversions.new end assert_equal( diff --git a/test/test_google_ads.rb b/test/test_google_ads.rb index e19729510..43a36d65d 100644 --- a/test/test_google_ads.rb +++ b/test/test_google_ads.rb @@ -23,7 +23,7 @@ class TestGoogleAds < Minitest::Test def test_valid_version() - assert_equal(true, Google::Ads::GoogleAds.valid_version?(:V15)) + assert_equal(true, Google::Ads::GoogleAds.valid_version?(:V16)) assert_equal(false, Google::Ads::GoogleAds.valid_version?(:ABCD)) end end diff --git a/test/test_google_ads_client.rb b/test/test_google_ads_client.rb index fb25a6c7b..49d15238e 100644 --- a/test/test_google_ads_client.rb +++ b/test/test_google_ads_client.rb @@ -21,7 +21,7 @@ require 'google/ads/google_ads/google_ads_client' -require 'google/ads/google_ads/v15/services/offline_user_data_job_service_pb' +require 'google/ads/google_ads/v16/services/offline_user_data_job_service_pb' module Google module Ads @@ -50,13 +50,13 @@ def test_initialize_no_config end def test_decode_partial_failure_error - response_with_pfe = Google::Ads::GoogleAds::V15::Services::AddOfflineUserDataJobOperationsResponse.new( + response_with_pfe = Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsResponse.new( partial_failure_error: Google::Rpc::Status.new( code: 13, message: "Multiple errors in ‘details’. First error: A required field was not specified or is an empty string., at operations[0].create.type", details: [ Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure", + type_url: "type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure", value: "\nh\n\x03\xB0\x05\x06\x129A required field was not specified or is an empty string.\x1A\x02*\x00\"\"\x12\x0E\n\noperations\x12\x00\x12\b\n\x06create\x12\x06\n\x04type\n=\n\x02P\x02\x12\x1FAn internal error has occurred.\x1A\x02*\x00\"\x12\x12\x10\n\noperations\x12\x02\b\x01".b ) ] @@ -70,17 +70,17 @@ def test_decode_partial_failure_error errors = client.decode_partial_failure_error( response_with_pfe.partial_failure_error, ) - assert_equal errors[0].class, Google::Ads::GoogleAds::V15::Errors::GoogleAdsFailure + assert_equal errors[0].class, Google::Ads::GoogleAds::V16::Errors::GoogleAdsFailure end def test_decode_warning - response_with_warning = Google::Ads::GoogleAds::V15::Services::AddOfflineUserDataJobOperationsResponse.new( + response_with_warning = Google::Ads::GoogleAds::V16::Services::AddOfflineUserDataJobOperationsResponse.new( warning: Google::Rpc::Status.new( code: 13, message: "Multiple errors in ‘details’. First error: A required field was not specified or is an empty string., at operations[0].create.type", details: [ Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure", + type_url: "type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure", value: "\nh\n\x03\xB0\x05\x06\x129A required field was not specified or is an empty string.\x1A\x02*\x00\"\"\x12\x0E\n\noperations\x12\x00\x12\b\n\x06create\x12\x06\n\x04type\n=\n\x02P\x02\x12\x1FAn internal error has occurred.\x1A\x02*\x00\"\x12\x12\x10\n\noperations\x12\x02\b\x01".b ) ] @@ -94,7 +94,7 @@ def test_decode_warning errors = client.decode_warning( response_with_warning.warning, ) - assert_equal errors[0].class, Google::Ads::GoogleAds::V15::Errors::GoogleAdsFailure + assert_equal errors[0].class, Google::Ads::GoogleAds::V16::Errors::GoogleAdsFailure end def test_config @@ -132,7 +132,7 @@ def test_service # No setup. end - service = client.service.v15.campaign + service = client.service.v16.campaign assert(service.respond_to?(:mutate_campaigns)) end @@ -141,7 +141,7 @@ def test_service_with_login_customer_id_set config.login_customer_id = 1234567890 end - service = client.service.v15.campaign + service = client.service.v16.campaign assert(service.respond_to?(:mutate_campaigns)) end @@ -151,7 +151,7 @@ def test_service_with_invalid_login_customer_id_set end assert_raises do - service = client.service.v15.campaign + service = client.service.v16.campaign end end diff --git a/test/test_logging_interceptor.rb b/test/test_logging_interceptor.rb index 710e74474..605e74162 100644 --- a/test/test_logging_interceptor.rb +++ b/test/test_logging_interceptor.rb @@ -21,15 +21,15 @@ require 'google/ads/google_ads' require 'google/ads/google_ads/interceptors/logging_interceptor' require 'google/ads/google_ads/v14/services/media_file_service_services_pb' -require 'google/ads/google_ads/v15/services/customer_user_access_service_services_pb' -require 'google/ads/google_ads/v15/services/customer_user_access_invitation_service_services_pb' -require 'google/ads/google_ads/v15/services/google_ads_service_services_pb' -require 'google/ads/google_ads/v15/services/feed_service_services_pb' -require 'google/ads/google_ads/v15/services/customer_service_services_pb' -require 'google/ads/google_ads/v15/resources/customer_user_access_pb' -require 'google/ads/google_ads/v15/resources/customer_user_access_invitation_pb' -require 'google/ads/google_ads/v15/resources/change_event_pb' -require 'google/ads/google_ads/v15/resources/feed_pb' +require 'google/ads/google_ads/v16/services/customer_user_access_service_services_pb' +require 'google/ads/google_ads/v16/services/customer_user_access_invitation_service_services_pb' +require 'google/ads/google_ads/v16/services/google_ads_service_services_pb' +require 'google/ads/google_ads/v16/services/feed_service_services_pb' +require 'google/ads/google_ads/v16/services/customer_service_services_pb' +require 'google/ads/google_ads/v16/resources/customer_user_access_pb' +require 'google/ads/google_ads/v16/resources/customer_user_access_invitation_pb' +require 'google/ads/google_ads/v16/resources/change_event_pb' +require 'google/ads/google_ads/v16/resources/feed_pb' class TestLoggingInterceptor < Minitest::Test attr_reader :sio @@ -147,13 +147,13 @@ def test_logging_interceptor_logs_response assert_includes(sio.read, JSON.dump("some data")) end - def test_logging_interceptor_logs_some_error_details_if_v15_error + def test_logging_interceptor_logs_some_error_details_if_v16_error li.request_response( request: make_small_request, call: make_fake_call, method: :doesnt_matter, ) do - raise make_realistic_error("v15") + raise make_realistic_error("v16") end rescue GRPC::InvalidArgument sio.rewind @@ -208,7 +208,7 @@ def test_logging_interceptor_sanitizes_customer_user_access_response call: make_fake_call, method: :doesnt_matter ) do - Google::Ads::GoogleAds::V15::Resources::CustomerUserAccess.new( + Google::Ads::GoogleAds::V16::Resources::CustomerUserAccess.new( email_address: email_address, inviter_user_email_address: inviter_user, ) @@ -224,9 +224,9 @@ def test_logging_interceptor_sanitizes_customer_user_access_response def test_logging_interceptor_sanitizes_customer_user_access_mutate email_address = "abcdefghijkl" inviter_user = "zyxwvutsr" - request = Google::Ads::GoogleAds::V15::Services::MutateCustomerUserAccessRequest.new( - operation: Google::Ads::GoogleAds::V15::Services::CustomerUserAccessOperation.new( - update: Google::Ads::GoogleAds::V15::Resources::CustomerUserAccess.new( + request = Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessRequest.new( + operation: Google::Ads::GoogleAds::V16::Services::CustomerUserAccessOperation.new( + update: Google::Ads::GoogleAds::V16::Resources::CustomerUserAccess.new( email_address: email_address, inviter_user_email_address: inviter_user, ) @@ -253,7 +253,7 @@ def test_logging_interceptor_sanitizes_customer_user_access_invitation_response call: make_fake_call, method: :doesnt_matter ) do - Google::Ads::GoogleAds::V15::Resources::CustomerUserAccessInvitation.new( + Google::Ads::GoogleAds::V16::Resources::CustomerUserAccessInvitation.new( email_address: email_address, ) end @@ -266,9 +266,9 @@ def test_logging_interceptor_sanitizes_customer_user_access_invitation_response def test_logging_interceptor_sanitizes_customer_user_access_invitation_mutate email_address = "abcdefghijkl" - request = Google::Ads::GoogleAds::V15::Services::MutateCustomerUserAccessInvitationRequest.new( - operation: Google::Ads::GoogleAds::V15::Services::CustomerUserAccessInvitationOperation.new( - create: Google::Ads::GoogleAds::V15::Resources::CustomerUserAccessInvitation.new( + request = Google::Ads::GoogleAds::V16::Services::MutateCustomerUserAccessInvitationRequest.new( + operation: Google::Ads::GoogleAds::V16::Services::CustomerUserAccessInvitationOperation.new( + create: Google::Ads::GoogleAds::V16::Resources::CustomerUserAccessInvitation.new( email_address: email_address, ) ) @@ -293,8 +293,8 @@ def test_logging_interceptor_sanitizes_feed_get call: make_fake_call, method: :doesnt_matter ) do - Google::Ads::GoogleAds::V15::Resources::Feed.new( - places_location_feed_data: Google::Ads::GoogleAds::V15:: + Google::Ads::GoogleAds::V16::Resources::Feed.new( + places_location_feed_data: Google::Ads::GoogleAds::V16:: Resources::Feed::PlacesLocationFeedData.new( email_address: email_address, ), @@ -314,8 +314,8 @@ def test_logging_interceptor_sanitizes_local_services_lead_contact_details_email call: make_fake_call, method: :doesnt_matter ) do - Google::Ads::GoogleAds::V15::Resources::LocalServicesLead.new( - contact_details: Google::Ads::GoogleAds::V15:: + Google::Ads::GoogleAds::V16::Resources::LocalServicesLead.new( + contact_details: Google::Ads::GoogleAds::V16:: Resources::ContactDetails.new( email: email_address, ), @@ -335,8 +335,8 @@ def test_logging_interceptor_sanitizes_local_services_lead_contact_details_phone call: make_fake_call, method: :doesnt_matter ) do - Google::Ads::GoogleAds::V15::Resources::LocalServicesLead.new( - contact_details: Google::Ads::GoogleAds::V15:: + Google::Ads::GoogleAds::V16::Resources::LocalServicesLead.new( + contact_details: Google::Ads::GoogleAds::V16:: Resources::ContactDetails.new( phone_number: phone_number, ), @@ -356,8 +356,8 @@ def test_logging_interceptor_sanitizes_local_services_lead_contact_details_consu call: make_fake_call, method: :doesnt_matter ) do - Google::Ads::GoogleAds::V15::Resources::LocalServicesLead.new( - contact_details: Google::Ads::GoogleAds::V15:: + Google::Ads::GoogleAds::V16::Resources::LocalServicesLead.new( + contact_details: Google::Ads::GoogleAds::V16:: Resources::ContactDetails.new( consumer_name: consumer_name, ), @@ -377,8 +377,8 @@ def test_logging_interceptor_sanitizes_local_services_lead_conversation_text call: make_fake_call, method: :doesnt_matter ) do - Google::Ads::GoogleAds::V15::Resources::LocalServicesLeadConversation.new( - message_details: Google::Ads::GoogleAds::V15:: + Google::Ads::GoogleAds::V16::Resources::LocalServicesLeadConversation.new( + message_details: Google::Ads::GoogleAds::V16:: Resources::MessageDetails.new( text: text, ), @@ -395,19 +395,19 @@ def test_logging_interceptor_sanitizes_feed_mutate_request email_address = "abcdefghijkl" email_address_2 = "zyxwvutsr" li.request_response( - request: Google::Ads::GoogleAds::V15::Services::MutateFeedsRequest.new( + request: Google::Ads::GoogleAds::V16::Services::MutateFeedsRequest.new( operations: [ - Google::Ads::GoogleAds::V15::Services::FeedOperation.new( - create: Google::Ads::GoogleAds::V15::Resources::Feed.new( - places_location_feed_data: Google::Ads::GoogleAds::V15:: + Google::Ads::GoogleAds::V16::Services::FeedOperation.new( + create: Google::Ads::GoogleAds::V16::Resources::Feed.new( + places_location_feed_data: Google::Ads::GoogleAds::V16:: Resources::Feed::PlacesLocationFeedData.new( email_address: email_address, ), ), ), - Google::Ads::GoogleAds::V15::Services::FeedOperation.new( - create: Google::Ads::GoogleAds::V15::Resources::Feed.new( - places_location_feed_data: Google::Ads::GoogleAds::V15:: + Google::Ads::GoogleAds::V16::Services::FeedOperation.new( + create: Google::Ads::GoogleAds::V16::Resources::Feed.new( + places_location_feed_data: Google::Ads::GoogleAds::V16:: Resources::Feed::PlacesLocationFeedData.new( email_address: email_address_2, ), @@ -430,7 +430,7 @@ def test_logging_interceptor_sanitizes_feed_mutate_request def test_logging_interceptor_sanitizes_customer_client_create_request email_address = "abcdefghijkl" li.request_response( - request: Google::Ads::GoogleAds::V15::Services::CreateCustomerClientRequest.new( + request: Google::Ads::GoogleAds::V16::Services::CreateCustomerClientRequest.new( email_address: email_address, ), call: make_fake_call, @@ -446,7 +446,7 @@ def test_logging_interceptor_sanitizes_customer_client_create_request def test_logging_interceptor_sanitizes_search_request li.request_response( - request: Google::Ads::GoogleAds::V15::Services::SearchGoogleAdsRequest.new( + request: Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsRequest.new( query: "SELECT change_event.user_email FROM change_event", ), call: make_fake_call, @@ -462,7 +462,7 @@ def test_logging_interceptor_sanitizes_search_request def test_logging_interceptor_sanitizes_search_stream_request li.request_response( - request: Google::Ads::GoogleAds::V15::Services::SearchGoogleAdsStreamRequest.new( + request: Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamRequest.new( query: "SELECT change_event.user_email FROM change_event", ), call: make_fake_call, @@ -485,7 +485,7 @@ def test_logging_interceptor_sanitizes_search_response call: make_fake_call, method: :doesnt_matter ) do - Google::Ads::GoogleAds::V15::Services::SearchGoogleAdsResponse.new( + Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsResponse.new( field_mask: Google::Protobuf::FieldMask.new( paths: [ "customer_user_access.email_address", @@ -494,12 +494,12 @@ def test_logging_interceptor_sanitizes_search_response ] ), results: [ - Google::Ads::GoogleAds::V15::Services::GoogleAdsRow.new( - customer_user_access: Google::Ads::GoogleAds::V15::Resources::CustomerUserAccess.new( + Google::Ads::GoogleAds::V16::Services::GoogleAdsRow.new( + customer_user_access: Google::Ads::GoogleAds::V16::Resources::CustomerUserAccess.new( email_address: email_address, inviter_user_email_address: inviter_user, ), - change_event: Google::Ads::GoogleAds::V15::Resources::ChangeEvent.new( + change_event: Google::Ads::GoogleAds::V16::Resources::ChangeEvent.new( user_email: user_email, ), ) @@ -525,7 +525,7 @@ def test_logging_interceptor_sanitizes_search_stream_response method: :doesnt_matter ) do [ - Google::Ads::GoogleAds::V15::Services::SearchGoogleAdsStreamResponse.new( + Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsStreamResponse.new( field_mask: Google::Protobuf::FieldMask.new( paths: [ "customer_user_access.email_address", @@ -534,12 +534,12 @@ def test_logging_interceptor_sanitizes_search_stream_response ] ), results: [ - Google::Ads::GoogleAds::V15::Services::GoogleAdsRow.new( - customer_user_access: Google::Ads::GoogleAds::V15::Resources::CustomerUserAccess.new( + Google::Ads::GoogleAds::V16::Services::GoogleAdsRow.new( + customer_user_access: Google::Ads::GoogleAds::V16::Resources::CustomerUserAccess.new( email_address: email_address, inviter_user_email_address: inviter_user, ), - change_event: Google::Ads::GoogleAds::V15::Resources::ChangeEvent.new( + change_event: Google::Ads::GoogleAds::V16::Resources::ChangeEvent.new( user_email: user_email, ), ) @@ -587,7 +587,7 @@ def make_realistic_response_with_partial_error message: "Multiple errors in ‘details’. First error: A required field was not specified or is an empty string., at operations[0].create.type", details: [ Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure", + type_url: "type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure", value: "\nh\n\x03\xB0\x05\x06\x129A required field was not specified or is an empty string.\x1A\x02*\x00\"\"\x12\x0E\n\noperations\x12\x00\x12\b\n\x06create\x12\x06\n\x04type\n=\n\x02P\x02\x12\x1FAn internal error has occurred.\x1A\x02*\x00\"\x12\x12\x10\n\noperations\x12\x02\b\x01".b ) ] @@ -619,7 +619,7 @@ def make_realistic_error(version) def make_error_metadata(version) { - "google.rpc.debuginfo-bin" => "\x12\xA9\x02[ORIGINAL ERROR] generic::invalid_argument: Invalid customer ID 'INSERT_CUSTOMER_ID_HERE'. [google.rpc.error_details_ext] { details { type_url: \"type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure\" value: \"\\n4\\n\\002\\010\\020\\022.Invalid customer ID \\'INSERT_CUSTOMER_ID_HERE\\'.\" } }", + "google.rpc.debuginfo-bin" => "\x12\xA9\x02[ORIGINAL ERROR] generic::invalid_argument: Invalid customer ID 'INSERT_CUSTOMER_ID_HERE'. [google.rpc.error_details_ext] { details { type_url: \"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure\" value: \"\\n4\\n\\002\\010\\020\\022.Invalid customer ID \\'INSERT_CUSTOMER_ID_HERE\\'.\" } }", "request-id" =>"btwmoTYjaQE1UwVZnDCGAA", } end diff --git a/test/test_lookup_util.rb b/test/test_lookup_util.rb index 3b18f2be4..399965496 100644 --- a/test/test_lookup_util.rb +++ b/test/test_lookup_util.rb @@ -35,8 +35,8 @@ class TestLookupUtil < Minitest::Test def test_path_instantiation lookup_util = Google::Ads::GoogleAds::LookupUtil.new - util = lookup_util.path_lookup_util(:V15) - assert_instance_of(Google::Ads::GoogleAds::Utils::V15::PathLookupUtil, util) + util = lookup_util.path_lookup_util(:V16) + assert_instance_of(Google::Ads::GoogleAds::Utils::V16::PathLookupUtil, util) assert_raises do util = client.proto_lookup_util(:ABCD) end diff --git a/test/test_object_creation.rb b/test/test_object_creation.rb index c41eb81f9..20c26aea4 100644 --- a/test/test_object_creation.rb +++ b/test/test_object_creation.rb @@ -26,8 +26,8 @@ def test_resource_creation_default() client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config| # No config needed. end - campaign_op = client.operation.v15.create_resource.campaign - assert_instance_of(Google::Ads::GoogleAds::V15::Resources::Campaign, campaign_op.create) + campaign_op = client.operation.v16.create_resource.campaign + assert_instance_of(Google::Ads::GoogleAds::V16::Resources::Campaign, campaign_op.create) end def test_resource_creation_from_existing_object() @@ -59,18 +59,18 @@ def test_operation_creation_default() client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config| # No config needed. end - mutate_op = client.operation.v15.mutate - assert_instance_of(Google::Ads::GoogleAds::V15::Services::MutateOperation, mutate_op) + mutate_op = client.operation.v16.mutate + assert_instance_of(Google::Ads::GoogleAds::V16::Services::MutateOperation, mutate_op) end def test_operation_creation_using_block() client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config| # No config needed. end - mutate_op = client.operation.v15.mutate do |op| - op.campaign_operation = client.operation.v15.create_resource.campaign + mutate_op = client.operation.v16.mutate do |op| + op.campaign_operation = client.operation.v16.create_resource.campaign end - assert_instance_of(Google::Ads::GoogleAds::V15::Services::MutateOperation, mutate_op) - assert_instance_of(Google::Ads::GoogleAds::V15::Services::CampaignOperation, mutate_op.campaign_operation) + assert_instance_of(Google::Ads::GoogleAds::V16::Services::MutateOperation, mutate_op) + assert_instance_of(Google::Ads::GoogleAds::V16::Services::CampaignOperation, mutate_op.campaign_operation) end end diff --git a/test/test_path_lookup_util.rb b/test/test_path_lookup_util.rb index 680e27de0..847dca2eb 100644 --- a/test/test_path_lookup_util.rb +++ b/test/test_path_lookup_util.rb @@ -20,11 +20,11 @@ require 'minitest/autorun' require 'google/ads/google_ads' -require 'google/ads/google_ads/utils/v15/path_lookup_util' +require 'google/ads/google_ads/utils/v16/path_lookup_util' class TestPathLookupUtil < Minitest::Test def test_basic_path_lookups - util = Google::Ads::GoogleAds::Utils::V15::PathLookupUtil.new + util = Google::Ads::GoogleAds::Utils::V16::PathLookupUtil.new expected = 'customers/123456' assert_equal(expected, util.customer(123456)) @@ -37,7 +37,7 @@ def test_basic_path_lookups end def test_malformed_path_input - util = Google::Ads::GoogleAds::Utils::V15::PathLookupUtil.new + util = Google::Ads::GoogleAds::Utils::V16::PathLookupUtil.new assert_raises ArgumentError do util.campaign(nil, nil) diff --git a/test/test_service_wrapper.rb b/test/test_service_wrapper.rb index bd4d35705..fa40657a9 100644 --- a/test/test_service_wrapper.rb +++ b/test/test_service_wrapper.rb @@ -19,7 +19,7 @@ require 'google/ads/google_ads/service_wrapper' require 'google/ads/google_ads/deprecation' -require 'google/ads/google_ads/v15/services/google_ads_service_pb' +require 'google/ads/google_ads/v16/services/google_ads_service_pb' class TestServiceWrapper < Minitest::Test class FakeService @@ -35,7 +35,7 @@ def setup @service = FakeService.new @service_wrapper = Google::Ads::GoogleAds::ServiceWrapper.new( service: @service, - rpc_inputs: {search: Google::Ads::GoogleAds::V15::Services::SearchGoogleAdsRequest}, + rpc_inputs: {search: Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsRequest}, deprecation: Google::Ads::GoogleAds::Deprecation.new(false, false), ) end @@ -112,6 +112,6 @@ def test_service_call_new_style_shortcut end def make_search_request(options) - Google::Ads::GoogleAds::V15::Services::SearchGoogleAdsRequest.new(options) + Google::Ads::GoogleAds::V16::Services::SearchGoogleAdsRequest.new(options) end end