Skip to content

Commit

Permalink
Changes for release v18_0.
Browse files Browse the repository at this point in the history
  • Loading branch information
yangda committed Oct 17, 2024
1 parent e42ff7f commit 39f1fab
Show file tree
Hide file tree
Showing 2,448 changed files with 116,475 additions and 106,335 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ lib/google/ads/google_ads/factories.rb
doc
.yardoc
lib/google/ads/google_ads/deprecation.rb

# For rbenv
.ruby-version
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
31.0.0
------
- Compatibility with v18 of the API: https://developers.google.com/google-ads/api/docs/release-notes
- Removed support for v15.

30.0.0
------
- Compatibility with v17.1 of the API: https://developers.google.com/google-ads/api/docs/release-notes
Expand Down
4 changes: 2 additions & 2 deletions codegen/spec/template_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:gapic_client_class) {
double(
:klass,
name: "Google::Ads::GoogleAds::V15::Services::GoogleAdsService::Client",
name: "Google::Ads::GoogleAds::V17::Services::GoogleAdsService::Client",
)
}

Expand All @@ -26,7 +26,7 @@
# require returns true, so let's just stub it here
allow(service).to receive(:require).with(path).and_return(true)
stub_const(
"Google::Ads::GoogleAds::V15::Services::GoogleAdsService::Service",
"Google::Ads::GoogleAds::V17::Services::GoogleAdsService::Service",
double(
:fake_service_klass,
rpc_descs: {Search: double(input: input)}
Expand Down
2 changes: 0 additions & 2 deletions examples/account_management/create_customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ def create_customer(manager_customer_id)
# [END create_customer]

if __FILE__ == $0
PAGE_SIZE = 1000

options = {}
# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
Expand Down
3 changes: 0 additions & 3 deletions examples/account_management/get_account_hierarchy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def get_account_hierarchy(manager_customer_id, login_customer_id)
response = google_ads_service.search(
customer_id: cid,
query: search_query,
page_size: PAGE_SIZE,
)

# Iterates over all rows in all pages to get all customer clients under
Expand Down Expand Up @@ -145,8 +144,6 @@ def print_account_hierarchy(customer_client, cid_to_children, depth)
end

if __FILE__ == $PROGRAM_NAME
PAGE_SIZE = 1000

options = {}
# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
Expand Down
6 changes: 0 additions & 6 deletions examples/account_management/get_change_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ def get_change_details(customer_id)
response = client.service.google_ads.search(
customer_id: customer_id,
query: query,
# The page size is superfluous with the default limit set above, but it's
# shown here since it's a good practice to use a reasonable page size when
# you set a higher limit.
page_size: PAGE_SIZE
)

# Process the results and output changes.
Expand Down Expand Up @@ -140,8 +136,6 @@ def get_value_from_path(path, object)
# [END get_change_details]

if __FILE__ == $PROGRAM_NAME
PAGE_SIZE = 1000

options = {}
# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
Expand Down
3 changes: 0 additions & 3 deletions examples/account_management/get_change_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def get_change_summary(customer_id)
response = client.service.google_ads.search(
customer_id: customer_id,
query: query,
page_size: PAGE_SIZE
)

# Process the results.
Expand Down Expand Up @@ -79,8 +78,6 @@ def get_change_summary(customer_id)
# [END get_change_summary]

if __FILE__ == $PROGRAM_NAME
PAGE_SIZE = 1000

options = {}
# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
Expand Down
2 changes: 0 additions & 2 deletions examples/account_management/list_accessible_customers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def list_accessible_customers()
# [END list_accessible_customers]

if __FILE__ == $0
PAGE_SIZE = 1000

begin
list_accessible_customers()
rescue Google::Ads::GoogleAds::Errors::GoogleAdsError => e
Expand Down
4 changes: 0 additions & 4 deletions examples/advanced_operations/add_ad_customizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,6 @@ def create_ad_with_customizations(client, customer_id, ad_group_id,
# [END add_ad_customizer_3]

if __FILE__ == $0
# We're doing only searches by resource_name in this example,
# we can set page size = 1.
PAGE_SIZE = 1;

options = {}
# Running the example with -h will print the command line usage.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def find_and_remove_criteria_from_shared_set(customer_id, campaign_id)
response = ga_service.search(
customer_id: customer_id,
query: query,
page_size: PAGE_SIZE,
)

response.each do |row|
Expand All @@ -62,7 +61,6 @@ def find_and_remove_criteria_from_shared_set(customer_id, campaign_id)
response = ga_service.search(
customer_id: customer_id,
query: query,
page_size: PAGE_SIZE,
)

response.each do |row|
Expand Down Expand Up @@ -92,7 +90,6 @@ def find_and_remove_criteria_from_shared_set(customer_id, campaign_id)
end

if __FILE__ == $PROGRAM_NAME
PAGE_SIZE = 1000

options = {}
# The following parameter(s) should be provided to run the example. You can
Expand Down
2 changes: 0 additions & 2 deletions examples/advanced_operations/get_ad_group_bid_modifiers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def get_ad_group_bid_modifiers(customer_id, ad_group_id = nil)
response = client.service.google_ads.search(
customer_id: customer_id,
query: search_query,
page_size: PAGE_SIZE,
)

response.each do |row|
Expand Down Expand Up @@ -101,7 +100,6 @@ def get_ad_group_bid_modifiers(customer_id, ad_group_id = nil)
end

if __FILE__ == $0
PAGE_SIZE = 1000
options = {}
# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
Expand Down
2 changes: 0 additions & 2 deletions examples/basic_operations/get_campaigns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def get_campaigns(customer_id)
# [END get_campaigns]

if __FILE__ == $0
PAGE_SIZE = 1000

options = {}
# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
Expand Down
2 changes: 0 additions & 2 deletions examples/billing/get_invoices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ def micro_to_base(amount)
end

if __FILE__ == $0
PAGE_SIZE = 1000

options = {}
# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
Expand Down
2 changes: 0 additions & 2 deletions examples/campaign_management/create_experiment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ def modify_draft_campaign(client, customer_id, draft_campaign)
end

if __FILE__ == $0
PAGE_SIZE = 1000

options = {}

# Running the example with -h will print the command line usage.
Expand Down
3 changes: 0 additions & 3 deletions examples/campaign_management/get_all_disapproved_ads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def get_all_disapproved_ads(customer_id, campaign_id)
response = ga_service.search(
customer_id: customer_id,
query: search_query,
page_size: PAGE_SIZE,
)

disapproved_ads_count = 0;
Expand Down Expand Up @@ -79,8 +78,6 @@ def get_all_disapproved_ads(customer_id, campaign_id)
end

if __FILE__ == $0
PAGE_SIZE = 1000

options = {}
# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
Expand Down
4 changes: 1 addition & 3 deletions examples/misc/campaign_report_to_csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
require 'csv'
require 'google/ads/google_ads'

PAGE_SIZE = 1000

def result_row_as_csv_hash(result_row)
{
"campaign.id": result_row.campaign.id.value,
Expand Down Expand Up @@ -56,7 +54,7 @@ def write_campaign_report_csv(customer_id, target_filepath)
ORDER BY segments.date DESC
QUERY

response = ga_service.search(customer_id: customer_id, query: query, page_size: PAGE_SIZE)
response = ga_service.search(customer_id: customer_id, query: query)
# convert the Google Ads response rows in to CSV ready hash objects
csv_rows = response.map { |row| result_row_as_csv_hash(row) }

Expand Down
Loading

0 comments on commit 39f1fab

Please sign in to comment.