Skip to content

Commit e3a2cd7

Browse files
authored
Changes for release v22_0. (#531)
1 parent 6681f82 commit e3a2cd7

1,403 files changed

Lines changed: 131365 additions & 140 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
36.0.0
2+
------
3+
- Compatibility with v22 of the API: https://developers.google.com/google-ads/api/docs/release-notes
4+
- Updated dependencies.
5+
- Updated Performance Max examples to add Asset automation settings.
6+
17
35.2.0
28
-----
39
- Made grpc versioning more permissive to allow any version except 1.74.0, to fix [issue#524](https://github.com/googleads/google-ads-ruby/issues/524).

Gemfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ gemspec
44

55
gem 'pry', '~> 0.14.1'
66

7-
# pull in the soap library for migration examples execution
8-
gem 'google-adwords-api', '~> 1.5'
9-
107
# used for the factories generator
118
gem 'activesupport', '>= 7.2'
129
gem 'rspec', '~> 3.11'

examples/advanced_operations/add_performance_max_campaign.rb

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,30 @@ def create_performance_max_campaign_operation(
192192
c.maximize_conversion_value = client.resource.maximize_conversion_value do |mcv|
193193
mcv.target_roas = 3.5
194194
end
195-
# Set the Final URL expansion opt out. This flag is specific to
196-
# Performance Max campaigns. If opted out (true), only the final URLs in
197-
# the asset group or URLs specified in the advertiser's Google Merchant
198-
# Center or business data feeds are targeted.
199-
# If opted in (false), the entire domain will be targeted. For best
200-
# results, set this value to false to opt in and allow URL expansions. You
201-
# can optionally add exclusions to limit traffic to parts of your website.
202-
c.url_expansion_opt_out = false
195+
196+
# [START add_pmax_asset_automation_settings]
197+
# Configures the optional opt-in/out status for asset automation settings.
198+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
199+
aas.asset_automation_type = :GENERATE_IMAGE_EXTRACTION
200+
aas.asset_automation_status = :OPTED_IN
201+
end
202+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
203+
aas.asset_automation_type = :FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION
204+
aas.asset_automation_status = :OPTED_IN
205+
end
206+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
207+
aas.asset_automation_type = :TEXT_ASSET_AUTOMATION
208+
aas.asset_automation_status = :OPTED_IN
209+
end
210+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
211+
aas.asset_automation_type = :GENERATE_ENHANCED_YOUTUBE_VIDEOS
212+
aas.asset_automation_status = :OPTED_IN
213+
end
214+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
215+
aas.asset_automation_type = :GENERATE_IMAGE_ENHANCEMENT
216+
aas.asset_automation_status = :OPTED_IN
217+
end
218+
# [END add_pmax_asset_automation_settings]
203219

204220
# Set if the campaign is enabled for brand guidelines. For more
205221
# information on brand guidelines, see
@@ -492,6 +508,7 @@ def create_and_link_image_asset(client, customer_id, url, field_type, asset_name
492508
end
493509
# [END add_performance_max_campaign_8]
494510

511+
# [START create_and_link_brand_assets]
495512
# Creates a list of MutateOperations that create linked brand assets.
496513
def create_and_link_brand_assets(
497514
client,
@@ -583,6 +600,7 @@ def create_and_link_brand_assets(
583600

584601
operations
585602
end
603+
# [END create_and_link_brand_assets]
586604

587605
# [START add_performance_max_campaign_9]
588606
# Create a list of MutateOperations that create AssetGroupSignals.

examples/shopping_ads/add_performance_max_retail_campaign.rb

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,27 @@ def create_performance_max_campaign_operation(
230230
# feed_label = "INSERT_FEED_LABEL_HERE"
231231
end
232232

233-
# Set the Final URL expansion opt out. This flag is specific to
234-
# Performance Max campaigns. If opted out (true), only the final URLs in
235-
# the asset group or URLs specified in the advertiser's Google Merchant
236-
# Center or business data feeds are targeted.
237-
# If opted in (false), the entire domain will be targeted. For best
238-
# results, set this value to false to opt in and allow URL expansions. You
239-
# can optionally add exclusions to limit traffic to parts of your website.
240-
#
241-
# For a Retail campaign, we want the final URLs to be limited to those
242-
# explicitly surfaced via GMC.
243-
c.url_expansion_opt_out = true
233+
# Configures the optional opt-in/out status for asset automation settings.
234+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
235+
aas.asset_automation_type = :GENERATE_IMAGE_EXTRACTION
236+
aas.asset_automation_status = :OPTED_IN
237+
end
238+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
239+
aas.asset_automation_type = :FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION
240+
aas.asset_automation_status = :OPTED_IN
241+
end
242+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
243+
aas.asset_automation_type = :TEXT_ASSET_AUTOMATION
244+
aas.asset_automation_status = :OPTED_IN
245+
end
246+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
247+
aas.asset_automation_type = :GENERATE_ENHANCED_YOUTUBE_VIDEOS
248+
aas.asset_automation_status = :OPTED_IN
249+
end
250+
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
251+
aas.asset_automation_type = :GENERATE_IMAGE_ENHANCEMENT
252+
aas.asset_automation_status = :OPTED_IN
253+
end
244254

245255
# Set if the campaign is enabled for brand guidelines. For more
246256
# information on brand guidelines, see

lib/google/ads/google_ads/api_versions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module Google
22
module Ads
33
module GoogleAds
4-
KNOWN_API_VERSIONS = [:V19, :V20, :V21]
5-
DEFAULT_API_VERSION = :V21
4+
KNOWN_API_VERSIONS = [:V19, :V20, :V21, :V22]
5+
DEFAULT_API_VERSION = :V22
66

77
def self.default_api_version
88
DEFAULT_API_VERSION
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Encoding: utf-8
2+
#
3+
# Copyright 2022 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# Utility that generates up resource names for entities given IDs.
18+
19+
require "google/ads/google_ads/utils/build_path_lookup_class"
20+
21+
module Google
22+
module Ads
23+
module GoogleAds
24+
module Utils
25+
module V22
26+
PathLookupUtil = Utils.build_path_lookup_class(:v22)
27+
end
28+
end
29+
end
30+
end
31+
end

lib/google/ads/google_ads/v19/services/batch_job_service/operations.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def initialize
135135
# @param options [::Gapic::CallOptions, ::Hash]
136136
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
137137
#
138-
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
138+
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
139139
# Pass arguments to `list_operations` via keyword arguments. Note that at
140140
# least one keyword argument is required. To specify no parameters, or to keep all
141141
# the default parameter values, pass an empty Hash as a request object (see above).
@@ -148,6 +148,17 @@ def initialize
148148
# The standard list page size.
149149
# @param page_token [::String]
150150
# The standard list page token.
151+
# @param return_partial_success [::Boolean]
152+
# When set to `true`, operations that are reachable are returned as normal,
153+
# and those that are unreachable are returned in the
154+
# [ListOperationsResponse.unreachable] field.
155+
#
156+
# This can only be `true` when reading across collections e.g. when `parent`
157+
# is set to `"projects/example/locations/-"`.
158+
#
159+
# This field is not by default supported and will result in an
160+
# `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
161+
# service or product specific documentation.
151162
#
152163
# @yield [response, operation] Access the result along with the RPC operation
153164
# @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]

lib/google/ads/google_ads/v19/services/campaign_draft_service/operations.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def initialize
135135
# @param options [::Gapic::CallOptions, ::Hash]
136136
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
137137
#
138-
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
138+
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
139139
# Pass arguments to `list_operations` via keyword arguments. Note that at
140140
# least one keyword argument is required. To specify no parameters, or to keep all
141141
# the default parameter values, pass an empty Hash as a request object (see above).
@@ -148,6 +148,17 @@ def initialize
148148
# The standard list page size.
149149
# @param page_token [::String]
150150
# The standard list page token.
151+
# @param return_partial_success [::Boolean]
152+
# When set to `true`, operations that are reachable are returned as normal,
153+
# and those that are unreachable are returned in the
154+
# [ListOperationsResponse.unreachable] field.
155+
#
156+
# This can only be `true` when reading across collections e.g. when `parent`
157+
# is set to `"projects/example/locations/-"`.
158+
#
159+
# This field is not by default supported and will result in an
160+
# `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
161+
# service or product specific documentation.
151162
#
152163
# @yield [response, operation] Access the result along with the RPC operation
153164
# @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]

lib/google/ads/google_ads/v19/services/experiment_service/operations.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def initialize
135135
# @param options [::Gapic::CallOptions, ::Hash]
136136
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
137137
#
138-
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
138+
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
139139
# Pass arguments to `list_operations` via keyword arguments. Note that at
140140
# least one keyword argument is required. To specify no parameters, or to keep all
141141
# the default parameter values, pass an empty Hash as a request object (see above).
@@ -148,6 +148,17 @@ def initialize
148148
# The standard list page size.
149149
# @param page_token [::String]
150150
# The standard list page token.
151+
# @param return_partial_success [::Boolean]
152+
# When set to `true`, operations that are reachable are returned as normal,
153+
# and those that are unreachable are returned in the
154+
# [ListOperationsResponse.unreachable] field.
155+
#
156+
# This can only be `true` when reading across collections e.g. when `parent`
157+
# is set to `"projects/example/locations/-"`.
158+
#
159+
# This field is not by default supported and will result in an
160+
# `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
161+
# service or product specific documentation.
151162
#
152163
# @yield [response, operation] Access the result along with the RPC operation
153164
# @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]

lib/google/ads/google_ads/v19/services/offline_user_data_job_service/operations.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def initialize
135135
# @param options [::Gapic::CallOptions, ::Hash]
136136
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
137137
#
138-
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
138+
# @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
139139
# Pass arguments to `list_operations` via keyword arguments. Note that at
140140
# least one keyword argument is required. To specify no parameters, or to keep all
141141
# the default parameter values, pass an empty Hash as a request object (see above).
@@ -148,6 +148,17 @@ def initialize
148148
# The standard list page size.
149149
# @param page_token [::String]
150150
# The standard list page token.
151+
# @param return_partial_success [::Boolean]
152+
# When set to `true`, operations that are reachable are returned as normal,
153+
# and those that are unreachable are returned in the
154+
# [ListOperationsResponse.unreachable] field.
155+
#
156+
# This can only be `true` when reading across collections e.g. when `parent`
157+
# is set to `"projects/example/locations/-"`.
158+
#
159+
# This field is not by default supported and will result in an
160+
# `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
161+
# service or product specific documentation.
151162
#
152163
# @yield [response, operation] Access the result along with the RPC operation
153164
# @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]

0 commit comments

Comments
 (0)