Skip to content

Commit c5cba61

Browse files
committed
Remove support for AdWords v201710.
1 parent d84a4ff commit c5cba61

8 files changed

Lines changed: 25 additions & 134 deletions

File tree

adwords_api/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.3.0:
2+
- Remove deprecated API version v201710.
3+
- Minor fix to paging through landscape pages using ServiceQuery.
4+
15
1.2.1:
26
- Support and examples for v201806.
37

adwords_api/examples/adwords_on_rails/app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base
99

1010
# Returns the API version in use.
1111
def get_api_version()
12-
return :v201710
12+
return :v201806
1313
end
1414

1515
# Returns currently selected account.

adwords_api/examples/v201806/optimization/get_keyword_bid_simulations.rb

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,20 @@ def get_criterion_bid_landscapes(ad_group_id, keyword_id)
3333
data_srv = adwords.service(:DataService, API_VERSION)
3434

3535
# Get keyword bid landscape.
36-
selector = {
37-
:fields => ['AdGroupId', 'CriterionId', 'StartDate', 'EndDate', 'Bid',
38-
'BiddableConversions', 'BiddableConversionsValue', 'LocalClicks',
39-
'LocalCost', 'LocalImpressions'],
40-
:predicates => [
41-
{:field => 'AdGroupId', :operator => 'IN', :values => [ad_group_id]},
42-
{:field => 'CriterionId', :operator => 'IN', :values => [keyword_id]},
43-
],
44-
:paging => {
45-
:start_index => 0,
46-
:number_results => PAGE_SIZE
47-
}
48-
}
49-
50-
start_index = 0
51-
landscape_points_in_previous_page = 0
52-
begin
53-
# Offset the start index by the number of landscape points in the last
54-
# retrieved page, NOT the number of entries (bid landscapes) in the page.
55-
start_index += landscape_points_in_previous_page
56-
selector[:paging][:start_index] = start_index
57-
58-
# Reset the count of landscape points in preparation for processing the
59-
# next page.
60-
landscape_points_in_previous_page = 0
36+
query_builder = adwords.service_query_builder do |b|
37+
b.select(%w[
38+
AdGroupId CriterionId StartDate EndDate Bid BiddableConversions
39+
BiddableConversionsValue LocalClicks LocalCost LocalImpressions
40+
])
41+
b.where('AdGroupId').equal_to(ad_group_id)
42+
b.where('CriterionId').equal_to(keyword_id)
43+
b.limit(0, PAGE_SIZE)
44+
end
45+
query = query_builder.build
6146

47+
loop do
6248
# Request the next page of bid landscapes.
63-
page = data_srv.get_criterion_bid_landscape(selector)
49+
page = data_srv.query_criterion_bid_landscape(query.to_s)
6450

6551
if page and page[:entries]
6652
puts "Bid landscape(s) retrieved: %d." % [page[:entries].length]
@@ -80,7 +66,9 @@ def get_criterion_bid_landscapes(ad_group_id, keyword_id)
8066
end
8167
end
8268
end
83-
end while landscape_points_in_previous_page >= PAGE_SIZE
69+
break unless query.has_next_landscape_page(page)
70+
query.next_page()
71+
end
8472
end
8573

8674
if __FILE__ == $0

adwords_api/lib/adwords_api/api_config.rb

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -42,57 +42,6 @@ class << ApiConfig
4242

4343
# Configure the services available to each version
4444
@@service_config = {
45-
:v201710 => [
46-
:AccountLabelService,
47-
:AdCustomizerFeedService,
48-
:AdGroupAdService,
49-
:AdGroupBidModifierService,
50-
:AdGroupCriterionService,
51-
:AdGroupExtensionSettingService,
52-
:AdGroupFeedService,
53-
:AdGroupService,
54-
:AdParamService,
55-
:AdwordsUserListService,
56-
:BatchJobService,
57-
:BiddingStrategyService,
58-
:BudgetOrderService,
59-
:BudgetService,
60-
:CampaignBidModifierService,
61-
:CampaignCriterionService,
62-
:CampaignExtensionSettingService,
63-
:CampaignFeedService,
64-
:CampaignGroupService,
65-
:CampaignGroupPerformanceTargetService,
66-
:CampaignService,
67-
:CampaignSharedSetService,
68-
:ConstantDataService,
69-
:ConversionTrackerService,
70-
:CustomerExtensionSettingService,
71-
:CustomerFeedService,
72-
:CustomerNegativeCriterionService,
73-
:CustomerService,
74-
:CustomerSyncService,
75-
:DataService,
76-
:DraftAsyncErrorService,
77-
:DraftService,
78-
:FeedItemService,
79-
:FeedMappingService,
80-
:FeedService,
81-
:LabelService,
82-
:LocationCriterionService,
83-
:ManagedCustomerService,
84-
:MediaService,
85-
:OfflineCallConversionFeedService,
86-
:OfflineConversionFeedService,
87-
:OfflineDataUploadService,
88-
:ReportDefinitionService,
89-
:SharedCriterionService,
90-
:SharedSetService,
91-
:TargetingIdeaService,
92-
:TrafficEstimatorService,
93-
:TrialAsyncErrorService,
94-
:TrialService
95-
],
9645
:v201802 => [
9746
:AccountLabelService,
9847
:AdCustomizerFeedService,
@@ -207,64 +156,13 @@ class << ApiConfig
207156
@@config = {
208157
:oauth_scope => 'https://www.googleapis.com/auth/adwords',
209158
:header_ns => 'https://adwords.google.com/api/adwords/cm/',
210-
:v201710 => 'https://adwords.google.com/api/adwords/',
211159
:v201802 => 'https://adwords.google.com/api/adwords/',
212160
:v201806 => 'https://adwords.google.com/api/adwords/'
213161
}
214162

215163
# Configure the subdirectories for each version / service pair.
216164
# A missing pair means that only the base URL is used.
217165
@@subdir_config = {
218-
# v201710
219-
[:v201710, :AccountLabelService] => 'mcm/',
220-
[:v201710, :AdCustomizerFeedService] => 'cm/',
221-
[:v201710, :AdGroupAdService] => 'cm/',
222-
[:v201710, :AdGroupBidModifierService] => 'cm/',
223-
[:v201710, :AdGroupCriterionService] => 'cm/',
224-
[:v201710, :AdGroupExtensionSettingService] => 'cm/',
225-
[:v201710, :AdGroupFeedService] => 'cm/',
226-
[:v201710, :AdGroupService] => 'cm/',
227-
[:v201710, :AdParamService] => 'cm/',
228-
[:v201710, :AdwordsUserListService] => 'rm/',
229-
[:v201710, :BatchJobService] => 'cm/',
230-
[:v201710, :BiddingStrategyService] => 'cm/',
231-
[:v201710, :BudgetOrderService] => 'billing/',
232-
[:v201710, :BudgetService] => 'cm/',
233-
[:v201710, :CampaignBidModifierService] => 'cm/',
234-
[:v201710, :CampaignCriterionService] => 'cm/',
235-
[:v201710, :CampaignExtensionSettingService] => 'cm/',
236-
[:v201710, :CampaignFeedService] => 'cm/',
237-
[:v201710, :CampaignGroupService] => 'cm/',
238-
[:v201710, :CampaignGroupPerformanceTargetService] => 'cm/',
239-
[:v201710, :CampaignService] => 'cm/',
240-
[:v201710, :CampaignSharedSetService] => 'cm/',
241-
[:v201710, :ConstantDataService] => 'cm/',
242-
[:v201710, :ConversionTrackerService] => 'cm/',
243-
[:v201710, :CustomerExtensionSettingService] => 'cm/',
244-
[:v201710, :CustomerFeedService] => 'cm/',
245-
[:v201710, :CustomerNegativeCriterionService] => 'cm/',
246-
[:v201710, :CustomerService] => 'mcm/',
247-
[:v201710, :CustomerSyncService] => 'ch/',
248-
[:v201710, :DraftAsyncErrorService] => 'cm/',
249-
[:v201710, :DataService] => 'cm/',
250-
[:v201710, :DraftService] => 'cm/',
251-
[:v201710, :FeedItemService] => 'cm/',
252-
[:v201710, :FeedMappingService] => 'cm/',
253-
[:v201710, :FeedService] => 'cm/',
254-
[:v201710, :LabelService] => 'cm/',
255-
[:v201710, :LocationCriterionService] => 'cm/',
256-
[:v201710, :ManagedCustomerService] => 'mcm/',
257-
[:v201710, :MediaService] => 'cm/',
258-
[:v201710, :OfflineCallConversionFeedService] => 'cm/',
259-
[:v201710, :OfflineConversionFeedService] => 'cm/',
260-
[:v201710, :OfflineDataUploadService] => 'rm/',
261-
[:v201710, :ReportDefinitionService] => 'cm/',
262-
[:v201710, :SharedCriterionService] => 'cm/',
263-
[:v201710, :SharedSetService] => 'cm/',
264-
[:v201710, :TargetingIdeaService] => 'o/',
265-
[:v201710, :TrafficEstimatorService] => 'o/',
266-
[:v201710, :TrialAsyncErrorService] => 'cm/',
267-
[:v201710, :TrialService] => 'cm/',
268166
# v201802
269167
[:v201802, :AccountLabelService] => 'mcm/',
270168
[:v201802, :AdCustomizerFeedService] => 'cm/',

adwords_api/lib/adwords_api/query_utils/service_query.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def has_next(page)
3636
def has_next_landscape_page(page)
3737
raise ArgumentError,
3838
'Cannot page through query with no LIMIT clause.' if @start_index.nil?
39+
return false unless page[:entries]
3940
total_landscape_points_in_page = 0
4041
page[:entries].each do |landscape|
4142
total_landscape_points_in_page += landscape[:landscape_points].size

adwords_api/lib/adwords_api/v201806/ad_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright:: Copyright 2018, Google Inc. All Rights Reserved.
66
# License:: Licensed under the Apache License, Version 2.0.
77
#
8-
# Code generated by AdsCommon library 1.0.1 on 2018-06-04 09:54:30.
8+
# Code generated by AdsCommon library 1.0.1 on 2018-07-24 09:30:53.
99

1010
require 'ads_common/savon_service'
1111
require 'adwords_api/v201806/ad_service_registry'

adwords_api/lib/adwords_api/v201806/ad_service_registry.rb

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

adwords_api/lib/adwords_api/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
module AdwordsApi
2121
module ApiConfig
22-
CLIENT_LIB_VERSION = '1.2.1'
22+
CLIENT_LIB_VERSION = '1.3.0'
2323
end
2424
end

0 commit comments

Comments
 (0)